mirror of
https://github.com/kovetskiy/mark.git
synced 2025-04-24 05:42:40 +08:00
allow templates and macros to include blanks in path (#191)
This commit is contained in:
parent
5428cc6833
commit
3c7bd6133f
@ -18,7 +18,7 @@ import (
|
|||||||
// <!-- Include: <template path>
|
// <!-- Include: <template path>
|
||||||
// <optional yaml data> -->
|
// <optional yaml data> -->
|
||||||
var reIncludeDirective = regexp.MustCompile(
|
var reIncludeDirective = regexp.MustCompile(
|
||||||
`(?s)<!--\s*Include:\s*(?P<template>\S+)\s*(\n(?P<config>.*?))?-->`)
|
`(?s)<!--\s*Include:\s*(?P<template>.+?)\s*(\n(?P<config>.*?))?-->`)
|
||||||
|
|
||||||
func LoadTemplate(
|
func LoadTemplate(
|
||||||
base string,
|
base string,
|
||||||
|
@ -21,7 +21,7 @@ var reMacroDirective = regexp.MustCompile(
|
|||||||
|
|
||||||
`(?s)` + // dot capture newlines
|
`(?s)` + // dot capture newlines
|
||||||
/**/ `<!--\s*Macro:\s*(?P<expr>[^\n]+)\n` +
|
/**/ `<!--\s*Macro:\s*(?P<expr>[^\n]+)\n` +
|
||||||
/* */ `\s*Template:\s*(?P<template>\S+)\s*` +
|
/* */ `\s*Template:\s*(?P<template>.+?)\s*` +
|
||||||
/* */ `(?P<config>\n.*?)?-->`,
|
/* */ `(?P<config>\n.*?)?-->`,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user