new sed for md to html
This commit is contained in:
parent
4408c4c97f
commit
488f7cd5b9
1 changed files with 1 additions and 6 deletions
|
|
@ -23,12 +23,7 @@ for file in ./src/*.md; do
|
||||||
_TITLE=$(grep -m1 "^# " "$file" | sed -r 's/# //')
|
_TITLE=$(grep -m1 "^# " "$file" | sed -r 's/# //')
|
||||||
|
|
||||||
# [foo](foo.md) -> [foo](foo.html)
|
# [foo](foo.md) -> [foo](foo.html)
|
||||||
# sed -i -r 's/(\[.*?\])\((.*?)\.md\)/\1(\2.html)/' "$file"
|
sed -i -E 's/(\[[^)]*\])\((([^.]*\.)*)md\)/\1(\2html)/g' $file
|
||||||
# sed does not support non-greedy (.*?) like perl, we have to hack it
|
|
||||||
sed -i -r \
|
|
||||||
-e ':loop' \
|
|
||||||
-e 's/(\[.*\])\((.*)\.md\)/\1(\2.html)/g' \
|
|
||||||
-e 't loop' $file
|
|
||||||
|
|
||||||
pandoc -s \
|
pandoc -s \
|
||||||
-f gfm+gfm_auto_identifiers-ascii_identifiers \
|
-f gfm+gfm_auto_identifiers-ascii_identifiers \
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue