notare 0.0.5 → 0.0.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/notare/nodes/run.rb +1 -1
- data/lib/notare/version.rb +1 -1
- data/lib/notare/xml_sanitizer.rb +15 -0
- data/lib/notare.rb +1 -0
- metadata +3 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: e372a9ac059766c98c42bedf692b8749eb4e87eed5e00a7df92069fdf1f30ba5
|
|
4
|
+
data.tar.gz: cbb03b6d5711702e6779ce55bbecb5670d957a70b34cb60235dd1608f8ce34e4
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 76184283c9b768946b126fc524b24fe7e0bc0b6accfcaf32c0e49e0b8664181dde5482474da7b82115c392efd927a66b173228447e460b0541a18eba61bad1f3
|
|
7
|
+
data.tar.gz: 6b52844671de33a128d4bd04975c265afa70e385c8877e898c4b5cbc3c6ef704caac28588800b793a3baa4a513dfd859bff83b46c2e5c0400c9ce54d30f82c9b
|
data/lib/notare/nodes/run.rb
CHANGED
|
@@ -8,7 +8,7 @@ module Notare
|
|
|
8
8
|
def initialize(text, bold: false, italic: false, underline: false,
|
|
9
9
|
strike: false, highlight: nil, color: nil, style: nil)
|
|
10
10
|
super()
|
|
11
|
-
@text = text
|
|
11
|
+
@text = XmlSanitizer.sanitize(text)
|
|
12
12
|
@bold = bold
|
|
13
13
|
@italic = italic
|
|
14
14
|
@underline = underline
|
data/lib/notare/version.rb
CHANGED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Notare
|
|
4
|
+
module XmlSanitizer
|
|
5
|
+
# Invalid XML 1.0 characters: 0x00, 0x01-0x08, 0x0B-0x0C, 0x0E-0x1F
|
|
6
|
+
# Valid whitespace preserved: 0x09 (tab), 0x0A (LF), 0x0D (CR)
|
|
7
|
+
INVALID_XML_CHARS = /[\x00-\x08\x0B\x0C\x0E-\x1F]/
|
|
8
|
+
|
|
9
|
+
def self.sanitize(text)
|
|
10
|
+
return text unless text.is_a?(String)
|
|
11
|
+
|
|
12
|
+
text.gsub(INVALID_XML_CHARS, "")
|
|
13
|
+
end
|
|
14
|
+
end
|
|
15
|
+
end
|
data/lib/notare.rb
CHANGED
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: notare
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.0.
|
|
4
|
+
version: 0.0.6
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Mathias
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date:
|
|
11
|
+
date: 2026-01-22 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: fastimage
|
|
@@ -141,6 +141,7 @@ files:
|
|
|
141
141
|
- lib/notare/xml/numbering.rb
|
|
142
142
|
- lib/notare/xml/relationships.rb
|
|
143
143
|
- lib/notare/xml/styles_xml.rb
|
|
144
|
+
- lib/notare/xml_sanitizer.rb
|
|
144
145
|
homepage: https://git.kaukus.no/Kaukus/Notare
|
|
145
146
|
licenses:
|
|
146
147
|
- MIT
|