Skip to content

Instantly share code, notes, and snippets.

@floriandierickx
Created April 6, 2019 11:57
Show Gist options
  • Save floriandierickx/3c93d6e41d1d238385e45cbc8ac4a6ac to your computer and use it in GitHub Desktop.
Save floriandierickx/3c93d6e41d1d238385e45cbc8ac4a6ac to your computer and use it in GitHub Desktop.
6059c6059,6060
< comment: !0
---
> comment: !0,
> citation: !0
6115a6117
> case u.citation:
6432a6435
> citation: !0,
8471c8474
< if (!(t.data("skip") || h.indexOf(A) > -1 || t[0].nodeType === document.COMMENT_NODE)) {
---
> if (!(t.data("skip") || h.indexOf(A) > -1 || t[0].nodeType === document.CITATION_NODE)) {
9243c9246
< NoInline: ["hr", "fences", "def_link", "code", "meta_block", "raw_edit", "math_block", "toc", "comment", "tag", "atag", "imgtag", "html_block"],
---
> NoInline: ["hr", "fences", "def_link", "code", "meta_block", "raw_edit", "math_block", "toc", "comment", "citation", "tag", "atag", "imgtag", "html_block"],
9282c9285,9286
< comment: "Comment"
---
> comment: "Comment",
> citation: "Citation"
14589a14594
> citation: /^(?:^|[ ;\[-])\@\w\S+([^\]\s]*)/,
14617c14622
< ut.comment_ext = /^<!(--|\u2013|\u2014)[\s\S]*?(--|\u2013|\u2014)>/, ut.link_ext = /^[\[\u3010]((?:[\[\u3010][^\]\u3011]*[\u3011\]]|[^\[\]\u3010\u3011])*)[\]\u3011]\(<?((?:\([^)]*\)|[^()])*?)>?[ \t]*((["'«»‘’‚‛„‟‹›])(.*?)["'«»‘’‚‛„‟‹›][ \t]*)?\)/, ut.image_ext = /(^\![\[\u3010]((?:[\[\u3010][^\]\u3011]*[\]\u3011]|[^\[\]\u3010\u3011])*)[\]\u3011][\(\uff08])(<?((?:[\(\uff08][^)\uff09]*[\)\uff09]|[^()\uff08\uff09])*?)>?)([\)\uff09](?:\s*{([^{}\(\)\uff08\uff09]*)})?)/, ut.attr_ext = /^{( *([#.][-\w_\uE006]+ *|[-\w_\uE006]+=[-\w_"'«»‘’‚‛„‟‹›\uE006]+ *)+)}/, ut._inside = /(?:\[[^\]]*\]|[^\[\]]|\](?=[^\[]*\]))*/, ut._inside_ext = /(?:[\[\u3010][^\]\u3011]*[\]\u3011]|[^\[\]\u3010\u3011]|[\]\u3011](?=[^\[\u3010]*[\]\u3011]))*/, ut.tag_ext = /^(?:<([A-Za-z][A-Za-z0-9-]*)(?:\s+[a-zA-Z_:][a-zA-Z0-9:._-]*(?:\s*=\s*(?:[^"'=<>`\x00-\x20]+|[’‚‛'‹›][^'’‚‛]*['’‚‛‹›]|["“«»„‟][^"“«»„‟]*["“«»„‟]))?)*\s*(\/?)>|<(\/)([A-Za-z][A-Za-z0-9-]*)\s*[>]|[<][?].*?[?][>]|<![A-Z]+\s+[^>]*>|<!\[CDATA\[[\s\S]*?\]\]>)/, ut.reflink = pt(ut.reflink)("inside", ut._inside)(), ut.normal = bt({}, ut), ut.pedantic = bt({}, ut.normal, {
---
> ut.comment_ext = /^<!(--|\u2013|\u2014)[\s\S]*?(--|\u2013|\u2014)>/, ut.citation_ext = /^(?:^|[ ;\[-])(\@|\u0040|\uFE6B|\uFF20|\u0040)\w\S+([^\]\s]*)/, ut.link_ext = /^[\[\u3010]((?:[\[\u3010][^\]\u3011]*[\u3011\]]|[^\[\]\u3010\u3011])*)[\]\u3011]\(<?((?:\([^)]*\)|[^()])*?)>?[ \t]*((["'«»‘’‚‛„‟‹›])(.*?)["'«»‘’‚‛„‟‹›][ \t]*)?\)/, ut.image_ext = /(^\![\[\u3010]((?:[\[\u3010][^\]\u3011]*[\]\u3011]|[^\[\]\u3010\u3011])*)[\]\u3011][\(\uff08])(<?((?:[\(\uff08][^)\uff09]*[\)\uff09]|[^()\uff08\uff09])*?)>?)([\)\uff09](?:\s*{([^{}\(\)\uff08\uff09]*)})?)/, ut.attr_ext = /^{( *([#.][-\w_\uE006]+ *|[-\w_\uE006]+=[-\w_"'«»‘’‚‛„‟‹›\uE006]+ *)+)}/, ut._inside = /(?:\[[^\]]*\]|[^\[\]]|\](?=[^\[]*\]))*/, ut._inside_ext = /(?:[\[\u3010][^\]\u3011]*[\]\u3011]|[^\[\]\u3010\u3011]|[\]\u3011](?=[^\[\u3010]*[\]\u3011]))*/, ut.tag_ext = /^(?:<([A-Za-z][A-Za-z0-9-]*)(?:\s+[a-zA-Z_:][a-zA-Z0-9:._-]*(?:\s*=\s*(?:[^"'=<>`\x00-\x20]+|[’‚‛'‹›][^'’‚‛]*['’‚‛‹›]|["“«»„‟][^"“«»„‟]*["“«»„‟]))?)*\s*(\/?)>|<(\/)([A-Za-z][A-Za-z0-9-]*)\s*[>]|[<][?].*?[?][>]|<![A-Z]+\s+[^>]*>|<!\[CDATA\[[\s\S]*?\]\]>)/, ut.reflink = pt(ut.reflink)("inside", ut._inside)(), ut.normal = bt({}, ut), ut.pedantic = bt({}, ut.normal, {
14765a14771,14780
> else if (r.autolink || !(d = this.rules.autolink.exec(t)))
> if (r.url || !(d = this.rules.url.exec(t)))
> if (d = (p ? this.rules.citation_ext : this.rules.citation).exec(t)) b += d[0].length, t = t.substring(d[0].length), u = d[0], p && (u = u.replace(/[\u2013\u2014]/g, "--"), g[b] = u.length - d[0].length), y.push({
> type: r.citation ? a.tag : a.citation,
> text: u
> });
> else if (d = this.rules.br.exec(t)) b += d[0].length, t = t.substring(d[0].length), y.push({
> type: "br",
> text: d[0]
> });
25482a25498,25499
> case c.citation:
> return "<span md-inline='citation' class='md-citation' spellcheck='false'>" + i.escapeForPreWrap(t.text, !1, !0) + "</span>";
30388a30406
> citation: "citation",
31382c31400
< r.block[0] == a.def_footnote && (o = o || File.editor.stylize.isAtFootnoteDefSpan()), o = o || r.inline.indexOf(a.inline_math) > -1, ["Strong", "Emphasis", "Underline", "Code", "Strike", "Hyperlink", "Image", "Clear Format", "Inline Math", "Highlight", "Subscript", "Superscript", "Comment"].map(function(e) {
---
> r.block[0] == a.def_footnote && (o = o || File.editor.stylize.isAtFootnoteDefSpan()), o = o || r.inline.indexOf(a.inline_math) > -1, ["Strong", "Emphasis", "Underline", "Code", "Strike", "Hyperlink", "Image", "Clear Format", "Inline Math", "Highlight", "Subscript", "Superscript", "Comment", "Citation"].map(function(e) {
31956a31975,31976
> }), n.getElementsByTagName = ut(function(t) {
> return t.appendChild(d.createCitation("")), !t.getElementsByTagName("*").length
37055d37074
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment