Escape Pango markup characters
This commit is contained in:
parent
b148049acc
commit
40d0c454c0
@ -121,7 +121,12 @@ function to_px(pt) {
|
||||
}
|
||||
|
||||
function escapeText(string) {
|
||||
return string.replace(/['".*+?^${}()|[\]\\\/]/g, '\\$&');
|
||||
return string
|
||||
.replace(/&/g, '\\&')
|
||||
.replace(/'/g, '\\'')
|
||||
.replace(/>/g, '\\>')
|
||||
.replace(/</g, '\\<')
|
||||
.replace(/[~`!".*+?%^${}()|[\]\\\/]/g, '\\$&');
|
||||
}
|
||||
|
||||
function render_textbox(textColor, font, fontSize, textAlign, text, id, textBoxWidth = null) {
|
||||
|
Loading…
Reference in New Issue
Block a user