Skip to content

Commit

Permalink
Symbols: Improve symbol transformations
Browse files Browse the repository at this point in the history
+ normalize leading whitespace
+ convert image tags ![alt-text](link] to alt-text
+ remove footnotes
  • Loading branch information
deathaxe committed Sep 13, 2021
1 parent 0dbdb18 commit 29c1840
Showing 1 changed file with 14 additions and 14 deletions.
28 changes: 14 additions & 14 deletions syntaxes/Symbol List - Heading.tmPreferences
Original file line number Diff line number Diff line change
@@ -1,32 +1,32 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>scope</key>
<string>text.html.markdown markup.heading</string>
<string>text.html.markdown markup.heading - meta.whitespace.newline</string>
<key>settings</key>
<dict>
<key>showInSymbolList</key>
<integer>1</integer>
<key>symbolTransformation</key>
<string>
s/\[([^]]+)\]\([^)]+\)/$1/g;
s/\[([^]]+)\]\[[^]]+\]/$1/g;
s/\[([^]]+)\]/$1/g;
s/\s*#+\s*$//g;
s/^\s*#(#*)\s*/$1/g;
s/^#{5}/ /g;
s/^#{4}/ /g;
s/^#{3}/ /g;
s/^#{2}/ /g;
s/^#{1}/ /g;
s/^(-+)\s*$/ $1/
s/\!?\[([^]]+)\]\([^)]*\)/$1/g; # strip image or link urls
s/\[([^]]+)\]\[[^]]*\]/$1/g; # strip reference urls
s/\[\^[^]]+\]//g; # strip footnotes
s/^\s*//g; # strip leading whitespace
s/\s*#+\s*\z//g; # strip trailing hashes
s/^#{6}/ /g; # indent atx heading 6
s/^#{5}/ /g; # indent atx heading
s/^#{4}/ /g; # indent atx heading
s/^#{3}/ /g; # indent atx heading
s/^#{2}/ /g; # indent atx heading
s/^#{1}//g; # indent atx heading
</string>
<key>showInIndexedSymbolList</key>
<integer>1</integer>
<key>symbolIndexTransformation</key>
<string>
s/\s*#+\s*$//g;
s/^\s*//g; # strip leading whitespace
s/\s*#+\s*\z//g; # strip trailing hashes
</string>
</dict>
</dict>
Expand Down

0 comments on commit 29c1840

Please sign in to comment.