Differences From
Artifact [c03c132cce]:
738 738 }
739 739 end
740 740 ct.spanctls = {
741 741 {seq = '!', parse = formatter 'emph'};
742 742 {seq = '*', parse = formatter 'strong'};
743 743 {seq = '~', parse = formatter 'strike'};
744 744 {seq = '+', parse = formatter 'insert'};
745 - {seq = '"', parse = rawcode};
746 - -- deprecated
747 - {seq = '`\\', parse = rawcode};
748 - {seq = '\\\\', parse = rawcode};
749 745 {seq = '\\', parse = function(s, c) -- raw
750 746 return {
751 747 kind = 'raw';
752 748 spans = {s};
753 749 origin = c:clone();
754 750 }
755 751 end};
756 752 {seq = '`', parse = formatter 'literal'};
753 + {seq = '"', parse = rawcode};
757 754 {seq = '$', parse = formatter 'variable'};
758 - {seq = '^', parse = function(s,c) --footnotes
759 - local r, t = s:match '^([^%s]+)%s*(.-)$'
755 + {seq = '^', parse = function(s, c)
756 + -- TODO support for footnote sections
757 + local fn, t = s:match '^([^%s]+)%s*(.-)$'
760 758 return {
761 759 kind = 'footnote';
762 - ref = r;
763 - spans = ct.parse_span(t, c);
760 + spans = (t and t~='') and ct.parse_span(t, c) or {};
761 + ref = fn;
764 762 origin = c:clone();
765 763 }
766 - -- TODO support for footnote sections
767 764 end};
768 765 {seq = '=', parse = function(s,c) --math mode
769 766 local tx = {
770 767 ['%*'] = 'ร';
771 768 ['/'] = 'รท';
772 769 }
773 770 for k,v in pairs(tx) do s = s:gsub(k,v) end
................................................................................
789 786 end};
790 787 {seq = '&', parse = function(s, c)
791 788 local r, t = s:match '^([^%s]+)%s*(.-)$'
792 789 return {
793 790 kind = 'deref';
794 791 spans = (t and t ~= "") and ct.parse_span(t, c) or {};
795 792 ref = r;
796 - origin = c:clone();
797 - }
798 - end};
799 - {seq = '^', parse = function(s, c)
800 - local fn, t = s:match '^([^%s]+)%s*(.-)$'
801 - return {
802 - kind = 'footnote';
803 - spans = (t and t~='') and ct.parse_span(t, c) or {};
804 - ref = fn;
805 793 origin = c:clone();
806 794 }
807 795 end};
808 796 {seq = '>', parse = insert_link};
809 797 {seq = 'โ', parse = insert_link};
810 798 {seq = '๐', parse = insert_link};
811 799 {seq = '##', parse = insert_var_ref(true)};