Skip to content
This repository was archived by the owner on Nov 25, 2020. It is now read-only.

Added options to applymarkdown #34

Merged
merged 1 commit into from
May 30, 2014
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 10 additions & 11 deletions src/core/utils.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -206,19 +206,18 @@ module.exports =
s = t
s

applyMarkdown: (text)->
# problems with markdown so far:
# - links are broken due to textexpansions (images too i guess)
applyMarkdown: (text, options = {})->
return null unless text

marked Encoder.htmlDecode(text),
gfm : true
pedantic : false
sanitize : true
highlight :(text, lang)->
if hljs.getLanguage lang
then hljs.highlight(lang,text).value
else text
options.gfm ?= true
options.pedantic ?= false
options.sanitize ?= true
options.highlight ?= (text, lang) ->
if hljs.getLanguage lang
then hljs.highlight(lang,text).value
else text

marked Encoder.htmlDecode(text), options

enterFullscreen: do ->

Expand Down