Fix quoting of closing comment tags in config

This commit is contained in:
Thomas Jensen 2021-06-18 20:54:21 +02:00
parent 89fea620e3
commit 4fc33e7cee
No known key found for this signature in database
GPG Key ID: A4ACEE270D0FB7DB
2 changed files with 67 additions and 45 deletions

View File

@ -297,8 +297,8 @@ shapes {
e ("*/")
}
replace "\\*/" with "*\\/" # quote closing comment tags
reverse "\\*\\\\/" to "*/"
replace "\\*\\/" with "*\\\\/" # quote closing comment tags
reverse "\\*\\\\/" to "*\\/"
Padding { h 1 }
@ -335,8 +335,8 @@ shapes {
padding { left 2 }
delimiter ?"
replace "\*/" with "*\/" # quote closing comment tags
reverse "\*\\/" to "*/"
replace "\*\/" with "*\\/" # quote closing comment tags
reverse "\*\\/" to "*\/"
elastic (s, w)
@ -371,8 +371,8 @@ shapes {
padding { left 1 }
delimiter ?"
replace "\*/" with "*\/" # quote closing comment tags
reverse "\*\\/" to "*/"
replace "\*\/" with "*\\/" # quote closing comment tags
reverse "\*\\/" to "*\/"
elastic (s, w, n)
@ -408,7 +408,7 @@ shapes {
padding { h 1 }
delim ?"
replace "-->" with "-\-\>"
replace "-->" with "-\\-\\>"
reverse "-\\-\\>" to "-->"
elastic (n,e,s,w)
@ -419,6 +419,40 @@ END html
# ============================================================================
BOX html-cmt
author "Thomas Jensen"
designer "(public domain)"
revision "1.0"
revdate "June 17, 1999 (Thursday, 19:59h)"
created "June 17, 1999 (Thursday, 19:59h)"
tags "simple, programming, comment"
sample
<!-- -->
<!-- regular comments used in HTML files -->
<!-- -->
ends
shapes {
w ("<!--")
e ("-->")
}
elastic (e, w)
padding { h 1 }
delim ?"
replace "-->" with "-\\-\\>"
reverse "-\\-\\>" to "-->"
END html-cmt
# ============================================================================
BOX shell
author "Thomas Jensen"
@ -1312,8 +1346,8 @@ shapes {
se ("/")
}
replace "\\*/" with "*\\/" # quote closing comment tags
reverse "\\*\\\\/" to "*/"
replace "\\*\\/" with "*\\\\/" # quote closing comment tags
reverse "\\*\\\\/" to "*\\/"
elastic (n,e,s,w)
@ -1382,34 +1416,6 @@ END pound-cmt
# ============================================================================
BOX html-cmt
author "Thomas Jensen"
designer "(public domain)"
revision "1.0"
revdate "June 17, 1999 (Thursday, 19:59h)"
created "June 17, 1999 (Thursday, 19:59h)"
tags "simple, programming, comment"
sample
<!-- -->
<!-- regular comments used in HTML files -->
<!-- -->
ends
shapes {
w ("<!-- ")
e (" -->")
}
elastic (e,w)
END html-cmt
# ============================================================================
BOX vim-cmt
author "Thomas Jensen"
@ -1665,8 +1671,8 @@ shapes {
}
delim ?"
replace "\*/" with "*\/" # quote closing comment tags
reverse "\*\\/" to "*/"
replace "\*\/" with "*\\/" # quote closing comment tags
reverse "\*\\/" to "*\/"
padding {
horiz 1
@ -2715,8 +2721,8 @@ shapes {
elastic (n, e, s, w)
delim ?"
replace "\*/" with "*\/"
reverse "\*\\/" to "*/"
replace "\*\/" with "*\\/"
reverse "\*\\/" to "*\/"
padding {
horiz 1
@ -2742,7 +2748,7 @@ sample
"""""""""""""""""""""""""""""""""""""""""""""""""""""""
ends
delim ?'
delim \'
shapes {
nw ('"') n ('"') ne ('"')
@ -2750,9 +2756,6 @@ shapes {
sw ('"') s ('"') se ('"')
}
replace '"' with '\"' # quote closing comment tags
reverse '\\\"' to '"'
padding {
horiz 1
}

View File

@ -0,0 +1,19 @@
:DESC
Tests that the 'peek' box design properly escapes closing comment tags.
:ARGS
-d peek -p h2
:INPUT
foo();
bar(); /* a comment */
baz();
:OUTPUT-FILTER
:EXPECTED
/* _\|/_
(o o)
+----oOO-{_}-OOo------------+
| foo(); |
| bar(); /* a comment *\/ |
| baz(); |
+--------------------------*/
:EOF