summaryrefslogtreecommitdiffstats
path: root/helpers/content_renderer.go
AgeCommit message (Collapse)Author
2018-01-23helpers: Avoid unescape in highlightBjørn Erik Pedersen
Fixes #4219
2017-09-25Use Chroma as new default syntax highlighterBjørn Erik Pedersen
If you want to use Pygments, set `pygmentsUseClassic=true` in your site config. Fixes #3888
2017-08-09Render task list item inside label for correct accessibilityDaniel Karlsson
Fixes #3303
2017-08-03helpers: Remove some unused funcsBjørn Erik Pedersen
2017-08-03Add some missing doc commentsJorin Vogel
As pointed out by the linter, some exported functions and types are missing doc comments. The linter warnings have been reduced from 194 to 116. Not all missing comments have been added in this commit though.
2017-08-02Remove sourceRelativeLinksBjørn Erik Pedersen
Fixes #3766
2017-08-02helpers: Fix broken TaskList in MarkdownAbdullah Diab
As per the referenced issue, if the task list in Markdown has nothing before it, it will be rendered wrongly: ``` --- title: "My First Post" date: 2017-07-29T20:21:57+02:00 draft: true --- * [ ] TaskList ``` is rendered as: ``` <ul> class="task-list" <li><input type="checkbox" disabled class="task-list-item"> TaskList</li> </ul> ``` The problem lies in the `List` function of `HugoHTMLRenderer`, it had a hardocded index of `4` for the first `>` of the list, it is used to insert the class into the text before the closing bracket, but that hardcoded index is only right when there is a newline before the opening bracket, which is the case when there is anything in the document before the task list, but if there is nothing, then there is no newline, and the correct index of the first `>` will be `3`. To fix that we're changing the hardcoded index to be dynamic by using `bytes.Index` to find it properly. We're also adding a test case to make sure this is tested against. Fixes #3710
2017-06-13Run gofmt to get imports in line vs gohugoio/hugoBjørn Erik Pedersen
2017-06-13all: Update import paths to gohugoio/hugoBjørn Erik Pedersen
2017-02-17all: Refactor to nonglobal Viper, i18n etc.Bjørn Erik Pedersen
This is a final rewrite that removes all the global state in Hugo, which also enables the use if `t.Parallel` in tests. Updates #2701 Fixes #3016
2016-10-24all: Unify case of config variable namesAlbert Nigmatzianov
All config variables starts with low-case and uses camelCase. If there is abbreviation at the beginning of the name, the whole abbreviation will be written in low-case. If there is abbreviation at the end of the name, the whole abbreviation will be written in upper-case. For example, rssURI.
2016-09-09Add TODO list support for BlackfridayBjørn Erik Pedersen
* Add CSS class to TODO list and list items * Add a flag to turn task list support off Fixes #2269
2016-09-08Fix shortcode vs pygmentsBjørn Erik Pedersen
This is the nth attempt to fix an issue by changing the placeholder token pattern, but now we actually have tests for all the historic trouble cases. Fixes #2223
2016-07-22Simplify the configuration of HugoHTMLRendererBjørn Erik Pedersen
2016-06-15Fix shortcode in markdown headersBjørn Erik Pedersen
This issue was introduced as a fix to shortcode not working in RST. One could argue that Blackfriday and friends should handle `#` in titles, but that will be a discussion for another day. The new placeholder pattern should be RST safe and work with titles. And now with a test so this doesn't break again. Fixes #2192 Fixes #2209 Closes #2210
2016-04-07Document and clean SourceRelativeLinksEval codeSven Dowideit
2016-04-04Disable syntax guessing for PygmentsCodeFences by defaultPhilipp Oppermann
This disables highlighting for fenced code blocks without explicitly specified language. It also introduces a new `PygmentsCodeFencesGuessSyntax` config option (defaulting to false). To enable syntax guessing again, add the following to your config file: `PygmentsCodeFencesGuessSyntax = true` This is a breaking change.
2016-03-24helpers: Apply GoLint rulesdigitalcraftsman
2016-03-01Some missing shortcode replacementsBjørn Erik Pedersen
See #1904
2016-03-01Fix shortcode handling in RSTBjørn Erik Pedersen
Fixes #1904
2016-01-01Source file based relative linkingSven Dowideit
ala GitHub repository markdown for both md files and non-md files Signed-off-by: Sven Dowideit <SvenDowideit@home.org.au>
2015-12-10Add copyright header to that source files that don’t have one.Anthony Fok
See #1646
2015-11-23Add PygmentsOptions optionAndrew Brampton
This allows default pygments settings to be used, if none are explictly set per shortcode. Fixes #1260
2015-10-12Apply project wide go fmtBjørn Erik Pedersen
2015-10-05Add GitHub style code fence support to mmarkAndrew Brampton
Fixes #1258.
2015-08-07Revert "Fix some Go code doc issues"Bjørn Erik Pedersen
This reverts commit de7dd70bbc1ac533f137e5f788e1b337d6ba6b8c. Broke the code fence feat.
2015-08-06Fix some Go code doc issuesBjørn Erik Pedersen
2015-07-08Add support for GitHub-flavoured markdown code fences for highlightingAndrew Brampton
This commit adds a new PygmentsCodeFences config option (default false), which if true will allow GitHub style backtick code fences around code, which will then be rendered by Pygments. For example: ``` language your code ``` can be used instead of {{< highlight language >}}your code {{< /highlight >}}. Fixes #362