summaryrefslogtreecommitdiffstats
path: root/hugolib/shortcode.go
diff options
context:
space:
mode:
authorypnos <github@lanrules.de>2016-03-20 21:40:03 +0100
committerBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>2016-04-09 00:48:53 +0200
commit9f6b5ad3b4f2ab7815a475cdf9d7dc354701ebb6 (patch)
tree25ce3f531cd419f2472e5e235603e3f9dcbe09cb /hugolib/shortcode.go
parente6e98bf52de8ad7d95808d4e0c57b9391aca966e (diff)
Save auto-detected markup type in Page.Markup
If Page.Markup was not set by the user, it will now be set after guessing from the file extension. This means, Page.Markup will be set in any case. It can be used by a theme to differentiate between markup types. Fixes #1950
Diffstat (limited to 'hugolib/shortcode.go')
-rw-r--r--hugolib/shortcode.go4
1 files changed, 2 insertions, 2 deletions
diff --git a/hugolib/shortcode.go b/hugolib/shortcode.go
index 782f0e21a..36d2058f1 100644
--- a/hugolib/shortcode.go
+++ b/hugolib/shortcode.go
@@ -234,7 +234,7 @@ func renderShortcode(sc shortcode, parent *ShortcodeWithPage, p *Page, t tpl.Tem
if sc.doMarkup {
newInner := helpers.RenderBytes(&helpers.RenderingContext{
- Content: []byte(inner), PageFmt: p.guessMarkupType(),
+ Content: []byte(inner), PageFmt: p.determineMarkupType(),
DocumentID: p.UniqueID(), Config: p.getRenderingConfig()})
// If the type is “unknown” or “markdown”, we assume the markdown
@@ -250,7 +250,7 @@ func renderShortcode(sc shortcode, parent *ShortcodeWithPage, p *Page, t tpl.Tem
// substitutions in <div>HUGOSHORTCODE-1</div> which prevents the
// generation, but means that you can’t use shortcodes inside of
// markdown structures itself (e.g., `[foo]({{% ref foo.md %}})`).
- switch p.guessMarkupType() {
+ switch p.determineMarkupType() {
case "unknown", "markdown":
if match, _ := regexp.MatchString(innerNewlineRegexp, inner); !match {
cleaner, err := regexp.Compile(innerCleanupRegexp)