Smartypants support, temporary branch switch

This commit is contained in:
Vit Brunner
2013-06-22 10:15:04 +01:00
parent f7dadb00c6
commit 7b2c8e7f35
3 changed files with 9 additions and 6 deletions
+1 -1
View File
@@ -2,7 +2,7 @@
script(src="//cdnjs.cloudflare.com/ajax/libs/lodash.js/1.2.1/lodash.js")
script(src="//cdnjs.cloudflare.com/ajax/libs/angular.js/1.1.5/angular.js")
// TODO use cdnjs.com once they serve marked
script(src="//raw.github.com/chjj/marked/master/lib/marked.js")
script(src="//raw.github.com/tasuk/marked/improve-smartypants/lib/marked.js")
script(src="scripts/app.js")
script(src="scripts/services/fetch.js")
script(src="scripts/services/reader/_factory.js")
@@ -52,6 +52,9 @@ angular.module("sideBySide").factory("markdownReader", () ->
})
return content
marked.setOptions({
smartypants: true
})
lexed = marked.lexer(source)
meta = lexed.shift()
meta = readMeta(meta.text, new marked.InlineLexer(lexed.links))
@@ -35,12 +35,12 @@ test("markdownReader", () ->
Source: '<a href="http://en.wikisource.org/wiki/Universal_Declaration_of_Human_Rights">http://en.wikisource.org/wiki/Universal_Declaration_of_Human_Rights</a>'
}
content: [
{ section: "1", text: "<p>All human beings are born <em>free</em> and equal in dignity and rights...</p>\n" }
{ section: "1", text: "<p>All human beings are born <em>free</em> and equal in dignity and rights</p>\n" }
{ section: "2", text: """
<p>Everyone is entitled to all the rights and freedoms...</p>
<p>Furthermore, no distinction shall be made on the basis of...</p>\n""" }
{ section: "11.1", text: "<p>Everyone charged with a penal offence has the right to be presumed...</p>\n" }
{ section: "11.2", text: "<p>No one shall be held guilty of any penal offence...</p>\n" }
<p>Everyone is entitled to all the rights and freedoms</p>
<p>Furthermore, no distinction shall be made on the basis of</p>\n""" }
{ section: "11.1", text: "<p>Everyone charged with a penal offence has the right to be presumed</p>\n" }
{ section: "11.2", text: "<p>No one shall be held guilty of any penal offence</p>\n" }
{ section: "13", text: """
<p>Everyone is entitled to:</p>
<ul>