diff options
| Commit | 7fc2422f038e0f56a9ac489eb4676b7b4bf2b6b1 (patch) | |
|---|---|---|
| Author | 2024-02-25 15:37:46 +0200 | |
| Committer | 2024-02-25 15:37:46 +0200 | |
| Files | acf68d8d8261ffc669078a9d0af115acd94d7c07 | |
| syndamia.com-7fc2422f038e0f56a9ac489eb4676b7b4bf2b6b1.tar syndamia.com-7fc2422f038e0f56a9ac489eb4676b7b4bf2b6b1.tar.gz syndamia.com-7fc2422f038e0f56a9ac489eb4676b7b4bf2b6b1.zip | ||
| Parent | 3fc1b4e5b19a8d2150e9272ab894b678ce90c7d6 (diff) | |
(awk-edits/MEL) Properly implemented one line tags
1 files changed, 8 insertions, 5 deletions
| -rw-r--r-- | awk-edits/MEL-parser.awk | 13 |
diff --git a/awk-edits/MEL-parser.awk b/awk-edits/MEL-parser.awk index 248eff2..6cf0514 100644 --- a/awk-edits/MEL-parser.awk +++ b/awk-edits/MEL-parser.awk @@ -35,6 +35,8 @@ BEGIN { function usesMEL() { MELOPEN = "o" MELCLOSE = "c" + MELLINEOPEN = "lo" + MELLINECLOSE = "lc" MELINSERT = "i" MELPARAGRAPH = "p" MELLINE = "l" @@ -52,6 +54,7 @@ melInsideCode == 0 && /^[ \t]*(<p>|<dt>)?&[{[()\]}:.]/ { newLine = "" lineCopy = $0 paragraphed = 0 + append = "" while (match(lineCopy, /&(((::|[[{(:.])[^[:space:].:;[{(<>)}\]&]+)|[\]})])/)) { RSTART += 5 RLENGTH -= 5 @@ -67,12 +70,12 @@ melInsideCode == 0 && /^[ \t]*(<p>|<dt>)?&[{[()\]}:.]/ { replaceWith = MEL[name, MELINSERT] } - # Inside one line TODO + # Inside one line else if (substr(lineCopy, RSTART, 2) == "::") { name = substr(lineCopy, RSTART + 2, RLENGTH - 2) - # RLENGTH = length(lineCopy) - replaceWith = MEL[name, MELLINE] + replaceWith = MEL[name, MELLINEOPEN] + append = append MEL[name, MELLINECLOSE] } # Inside paragraph else if (substr(lineCopy, RSTART, 1) == ":") { @@ -93,7 +96,7 @@ melInsideCode == 0 && /^[ \t]*(<p>|<dt>)?&[{[()\]}:.]/ { newLine = newLine substr(lineCopy, 0, RSTART - 6) replaceWith lineCopy = substr(lineCopy, RSTART + RLENGTH) } - $0 = newLine lineCopy - if (paragraphed == 0 && length(newLine) > 0) + $0 = newLine lineCopy append + if (paragraphed == 0 && newLine != "") gsub(/(<p>|<\/p>)/, "") } |