diff options
| author | Dan Allen <dan.j.allen@gmail.com> | 2023-06-22 23:54:31 -0600 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-06-22 23:54:31 -0600 |
| commit | 46393dc39203ef0579d03c5cc965fc03270d6a80 (patch) | |
| tree | 61edbe44a82290c59c3d15718884f38e988241ed /lib | |
| parent | 0c2f648cbdf1c4ea522b920e8dd6759adfc1d0e5 (diff) | |
resolves #2430 remove null character enclosed by XML tag when sanitizing text (PR #2431)
Diffstat (limited to 'lib')
| -rw-r--r-- | lib/asciidoctor/pdf/sanitizer.rb | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/asciidoctor/pdf/sanitizer.rb b/lib/asciidoctor/pdf/sanitizer.rb index 8c009ca9..e5574414 100644 --- a/lib/asciidoctor/pdf/sanitizer.rb +++ b/lib/asciidoctor/pdf/sanitizer.rb @@ -19,11 +19,11 @@ module Asciidoctor 'nbsp' => ' ', 'quot' => '"', }).default = '?' - SanitizeXMLRx = /<[^>]+>/ + SanitizeXMLRx = /<[^>]+>\0?/ CharRefRx = /&(?:amp;)?(?:([a-z][a-z]+\d{0,2})|#(?:(\d\d\d{0,4})|x(\h\h\h{0,3})));/ UnescapedAmpersandRx = /&(?!(?:[a-z][a-z]+\d{0,2}|#(?:\d\d\d{0,4}|x\h\h\h{0,3}));)/ - # Strip leading, trailing and repeating whitespace, remove XML tags and + # Strip leading, trailing and repeating whitespace, remove XML tags along with an enclosed null character, and # resolve all entities in the specified string. # # FIXME: move to a module so we can mix it in elsewhere |
