diff options
author | Ralph Amissah <ralph.amissah@gmail.com> | 2020-04-24 23:36:46 -0400 |
---|---|---|
committer | Ralph Amissah <ralph.amissah@gmail.com> | 2020-05-20 11:27:26 -0400 |
commit | ef2135e4fe16604b40956a2c345cdc0ae467b65c (patch) | |
tree | c14dcacf4608d23eb5a7afd622c1e1af4b648ab6 /org/out_sqlite.org | |
parent | footnote/endnote fix (diff) |
xmls, sqlite more with footnotes/endnotes
Diffstat (limited to 'org/out_sqlite.org')
-rw-r--r-- | org/out_sqlite.org | 70 |
1 files changed, 11 insertions, 59 deletions
diff --git a/org/out_sqlite.org b/org/out_sqlite.org index 77172e2..a35bcf1 100644 --- a/org/out_sqlite.org +++ b/org/out_sqlite.org @@ -510,15 +510,6 @@ string munge_html(M,O)( string _notes; string _urls; string _txt = _html_font_face(_html_special_characters(obj.text)); - if (_txt.matchFirst(rgx.inline_notes_al_gen)) { - foreach (m; _txt.matchAll(rgx.inline_notes_al_gen_text)) { - _notes ~= "\n" ~ m["text"]; - } - _txt = _txt.replaceAll(rgx.inline_notes_al_gen_ref, "<sup>$1</sup> "); - } - if (_notes.length > 0) { - _txt ~= _notes; - } { /+ debug +/ if (doc_matters.opt.action.debug_do && doc_matters.opt.action.verbose) { @@ -732,11 +723,17 @@ string inline_notes_scroll(M,O)( string _txt, ) { if (obj.has.inline_notes_reg) { - // _txt = font_face(_txt); - _txt = _txt.replaceAll( - rgx.inline_notes_al_regular_number_note, - ("<a href=\"#note_$1\"><note id=\"noteref_$1\"> <sup>$1</sup> </note></a>") - ); + string[] _endnotes; + foreach(m; _txt.matchAll(rgx.inline_notes_al_regular_number_note)) { + _endnotes ~= "<p class=\"endnote\">" + ~ "<sup>" ~ m.captures["num"] ~ ".</sup>" + ~ m.captures["note"] + ~ "</p>"; + } + _txt = replaceAll!(m => + (" " ~ "<sup>" ~ m["num"] ~ "</sup>")) + (_txt, rgx.inline_notes_al_regular_number_note) + ~ _endnotes.join("\n"); } debug(markup_endnotes) { if (_txt.match(rgx.inline_notes_al_regular_number_note)) { @@ -752,51 +749,6 @@ string inline_notes_scroll(M,O)( } #+END_SRC -******** seg - -#+NAME: sanitize_and_munge_inline_html -#+BEGIN_SRC d -Tuple!(string, string[]) inline_notes_seg(M,O)( - M doc_matters, - const O obj, - string _txt, -) { - string[] _endnotes; - if (obj.has.inline_notes_reg) { - /+ need markup for text, and separated footnote +/ - foreach(m; _txt.matchAll(rgx.inline_notes_al_regular_number_note)) { - _endnotes ~= format( - "%s%s%s%s\n %s%s%s%s%s\n %s\n%s", - "<p class=\"endnote\">", - "<a href=\"#noteref_", - m.captures[1], - "\">", - "<note id=\"note_", - m.captures[1], - "\"> <sup>", - m.captures[1], - ".</sup></note></a>", - m.captures[2], - "</p>" - ); - } - _txt = _txt.replaceAll( - rgx.inline_notes_al_regular_number_note, - ("<a href=\"#note_$1\"><note id=\"noteref_$1\"> <sup>$1</sup> </note></a>") - ); - } else if (_txt.match(rgx.inline_notes_al_regular_number_note)) { - debug(markup) { - writeln(__LINE__, " endnote: ", obj.metainfo.is_a, ": ", obj.text); - } - } - Tuple!(string, string[]) t = tuple( - _txt, - _endnotes, - ); - return t; -} -#+END_SRC - ******* inline markup #+NAME: sanitize_and_munge_inline_html |