"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "markup/org/convert.go" between
hugo-0.80.0.tar.gz and hugo-0.81.0.tar.gz

About: Hugo is a static site generator that takes a source directory of Markdown files and templates and uses these as input to create a complete website (written in Go).

convert.go  (hugo-0.80.0):convert.go  (hugo-0.81.0)
skipping to change at line 55 skipping to change at line 55
} }
func (c *orgConverter) Convert(ctx converter.RenderContext) (converter.Result, e rror) { func (c *orgConverter) Convert(ctx converter.RenderContext) (converter.Result, e rror) {
logger := c.cfg.Logger logger := c.cfg.Logger
config := org.New() config := org.New()
config.Log = logger.Warn() config.Log = logger.Warn()
config.ReadFile = func(filename string) ([]byte, error) { config.ReadFile = func(filename string) ([]byte, error) {
return afero.ReadFile(c.cfg.ContentFs, filename) return afero.ReadFile(c.cfg.ContentFs, filename)
} }
writer := org.NewHTMLWriter() writer := org.NewHTMLWriter()
writer.PrettyRelativeLinks = !c.cfg.Cfg.GetBool("uglyURLs")
writer.HighlightCodeBlock = func(source, lang string, inline bool) string { writer.HighlightCodeBlock = func(source, lang string, inline bool) string {
highlightedSource, err := c.cfg.Highlight(source, lang, "") highlightedSource, err := c.cfg.Highlight(source, lang, "")
if err != nil { if err != nil {
logger.Errorf("Could not highlight source as lang %s. Usi ng raw source.", lang) logger.Errorf("Could not highlight source as lang %s. Usi ng raw source.", lang)
return source return source
} }
return highlightedSource return highlightedSource
} }
html, err := config.Parse(bytes.NewReader(ctx.Src), c.ctx.DocumentName).W rite(writer) html, err := config.Parse(bytes.NewReader(ctx.Src), c.ctx.DocumentName).W rite(writer)
 End of changes. 1 change blocks. 
0 lines changed or deleted 1 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)