mirror of
https://github.com/wassname/side-by-side.git
synced 2026-09-09 11:34:24 +08:00
Smartypants support, temporary branch switch
This commit is contained in:
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user