mirror of
https://github.com/ascii-boxes/boxes.git
synced 2024-12-13 10:20:37 +01:00
Fix quoting of closing comment tags in config
This commit is contained in:
parent
89fea620e3
commit
4fc33e7cee
93
boxes-config
93
boxes-config
@ -297,8 +297,8 @@ shapes {
|
|||||||
e ("*/")
|
e ("*/")
|
||||||
}
|
}
|
||||||
|
|
||||||
replace "\\*/" with "*\\/" # quote closing comment tags
|
replace "\\*\\/" with "*\\\\/" # quote closing comment tags
|
||||||
reverse "\\*\\\\/" to "*/"
|
reverse "\\*\\\\/" to "*\\/"
|
||||||
|
|
||||||
Padding { h 1 }
|
Padding { h 1 }
|
||||||
|
|
||||||
@ -335,8 +335,8 @@ shapes {
|
|||||||
padding { left 2 }
|
padding { left 2 }
|
||||||
|
|
||||||
delimiter ?"
|
delimiter ?"
|
||||||
replace "\*/" with "*\/" # quote closing comment tags
|
replace "\*\/" with "*\\/" # quote closing comment tags
|
||||||
reverse "\*\\/" to "*/"
|
reverse "\*\\/" to "*\/"
|
||||||
|
|
||||||
elastic (s, w)
|
elastic (s, w)
|
||||||
|
|
||||||
@ -371,8 +371,8 @@ shapes {
|
|||||||
padding { left 1 }
|
padding { left 1 }
|
||||||
|
|
||||||
delimiter ?"
|
delimiter ?"
|
||||||
replace "\*/" with "*\/" # quote closing comment tags
|
replace "\*\/" with "*\\/" # quote closing comment tags
|
||||||
reverse "\*\\/" to "*/"
|
reverse "\*\\/" to "*\/"
|
||||||
|
|
||||||
elastic (s, w, n)
|
elastic (s, w, n)
|
||||||
|
|
||||||
@ -408,7 +408,7 @@ shapes {
|
|||||||
padding { h 1 }
|
padding { h 1 }
|
||||||
|
|
||||||
delim ?"
|
delim ?"
|
||||||
replace "-->" with "-\-\>"
|
replace "-->" with "-\\-\\>"
|
||||||
reverse "-\\-\\>" to "-->"
|
reverse "-\\-\\>" to "-->"
|
||||||
|
|
||||||
elastic (n,e,s,w)
|
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
|
BOX shell
|
||||||
|
|
||||||
author "Thomas Jensen"
|
author "Thomas Jensen"
|
||||||
@ -1312,8 +1346,8 @@ shapes {
|
|||||||
se ("/")
|
se ("/")
|
||||||
}
|
}
|
||||||
|
|
||||||
replace "\\*/" with "*\\/" # quote closing comment tags
|
replace "\\*\\/" with "*\\\\/" # quote closing comment tags
|
||||||
reverse "\\*\\\\/" to "*/"
|
reverse "\\*\\\\/" to "*\\/"
|
||||||
|
|
||||||
elastic (n,e,s,w)
|
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
|
BOX vim-cmt
|
||||||
|
|
||||||
author "Thomas Jensen"
|
author "Thomas Jensen"
|
||||||
@ -1665,8 +1671,8 @@ shapes {
|
|||||||
}
|
}
|
||||||
|
|
||||||
delim ?"
|
delim ?"
|
||||||
replace "\*/" with "*\/" # quote closing comment tags
|
replace "\*\/" with "*\\/" # quote closing comment tags
|
||||||
reverse "\*\\/" to "*/"
|
reverse "\*\\/" to "*\/"
|
||||||
|
|
||||||
padding {
|
padding {
|
||||||
horiz 1
|
horiz 1
|
||||||
@ -2715,8 +2721,8 @@ shapes {
|
|||||||
elastic (n, e, s, w)
|
elastic (n, e, s, w)
|
||||||
|
|
||||||
delim ?"
|
delim ?"
|
||||||
replace "\*/" with "*\/"
|
replace "\*\/" with "*\\/"
|
||||||
reverse "\*\\/" to "*/"
|
reverse "\*\\/" to "*\/"
|
||||||
|
|
||||||
padding {
|
padding {
|
||||||
horiz 1
|
horiz 1
|
||||||
@ -2742,7 +2748,7 @@ sample
|
|||||||
"""""""""""""""""""""""""""""""""""""""""""""""""""""""
|
"""""""""""""""""""""""""""""""""""""""""""""""""""""""
|
||||||
ends
|
ends
|
||||||
|
|
||||||
delim ?'
|
delim \'
|
||||||
|
|
||||||
shapes {
|
shapes {
|
||||||
nw ('"') n ('"') ne ('"')
|
nw ('"') n ('"') ne ('"')
|
||||||
@ -2750,9 +2756,6 @@ shapes {
|
|||||||
sw ('"') s ('"') se ('"')
|
sw ('"') s ('"') se ('"')
|
||||||
}
|
}
|
||||||
|
|
||||||
replace '"' with '\"' # quote closing comment tags
|
|
||||||
reverse '\\\"' to '"'
|
|
||||||
|
|
||||||
padding {
|
padding {
|
||||||
horiz 1
|
horiz 1
|
||||||
}
|
}
|
||||||
|
19
test/169_peek_escape_comments.txt
Normal file
19
test/169_peek_escape_comments.txt
Normal 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
|
Loading…
Reference in New Issue
Block a user