forked from GitHub/gf-core
Rewrite <a name=...> to <div id=...> to preserve page anchors in Pandoc
This commit is contained in:
@@ -22,6 +22,9 @@ function render_t2t_html {
|
|||||||
--outfile="$tmp" \
|
--outfile="$tmp" \
|
||||||
--infile="$t2t"
|
--infile="$t2t"
|
||||||
|
|
||||||
|
# Replace <A NAME="toc3"></A> with <div id="toc3"></div> so that Pandoc retains it
|
||||||
|
sed -i.bak "s/<A NAME=\"\(.*\)\"><\/A>/<div id=\"\1\"><\/div>/" "$tmp" && rm "$tmp.bak"
|
||||||
|
|
||||||
# Capture first 3 lines of t2t file: title, author, date
|
# Capture first 3 lines of t2t file: title, author, date
|
||||||
# Documentation here: https://txt2tags.org/userguide/headerarea
|
# Documentation here: https://txt2tags.org/userguide/headerarea
|
||||||
l1=$(head -n 1 "$t2t")
|
l1=$(head -n 1 "$t2t")
|
||||||
|
|||||||
Reference in New Issue
Block a user