Compare commits
No commits in common. "d81c512cb9e8e86df7121965b1b8915428ab4b56" and "a4d03c8e8d88e7a8031407a74c4491c0c0183398" have entirely different histories.
d81c512cb9
...
a4d03c8e8d
@ -45,14 +45,6 @@ function replaceInline(line, result, start, end) {
|
|||||||
# Build the result: before match, <em>, content, </em>, after match
|
# Build the result: before match, <em>, content, </em>, after match
|
||||||
line = substr(line, 1, start-1) "<em>" substr(line, start+1, RLENGTH-2) "</em>" substr(line, end+1)
|
line = substr(line, 1, start-1) "<em>" substr(line, start+1, RLENGTH-2) "</em>" substr(line, end+1)
|
||||||
}
|
}
|
||||||
# Replace occurrences of `...` with <code>...</code>
|
|
||||||
while (match(line, /`([^`]+)`/)) {
|
|
||||||
|
|
||||||
start = RSTART
|
|
||||||
end = RSTART + RLENGTH - 1
|
|
||||||
# Build the result: before match, <em>, content, </em>, after match
|
|
||||||
line = substr(line, 1, start-1) "<code>" substr(line, start+1, RLENGTH-2) "</code>" substr(line, end+1)
|
|
||||||
}
|
|
||||||
|
|
||||||
# Replace occurances of [link](url) with <a href="url">link</<a>
|
# Replace occurances of [link](url) with <a href="url">link</<a>
|
||||||
while (match(line, /\[([^\]]+)\]\([^\)]+\)/)) {
|
while (match(line, /\[([^\]]+)\]\([^\)]+\)/)) {
|
||||||
|
@ -116,9 +116,6 @@ declare -a tests=(
|
|||||||
"A link to [wikipedia](https://www.wikipedia.org)"
|
"A link to [wikipedia](https://www.wikipedia.org)"
|
||||||
"<p>A link to <a href=\"https://www.wikipedia.org\">wikipedia</a></p>"
|
"<p>A link to <a href=\"https://www.wikipedia.org\">wikipedia</a></p>"
|
||||||
|
|
||||||
"Inline code"
|
|
||||||
"A simple function \`printf()\`"
|
|
||||||
"<p>A simple function <code>printf()</code></p>"
|
|
||||||
|
|
||||||
# You can add more test cases following the same format...
|
# You can add more test cases following the same format...
|
||||||
)
|
)
|
||||||
|
Loading…
Reference in New Issue
Block a user