markbridge 0.1.2 → 0.1.3
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
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: cd32ca1996ac298962ade2f5728f0e0b9999ae0e2934b44474e003ca74888e32
|
|
4
|
+
data.tar.gz: 43334aa515a7326ac7e514e1ebd252f7517866a6fe254c350f7c51085ca26ba4
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: a2d9e6f8ed438bbe9425a33c4cf834e707bea7efc953bfd0d1c1aa53faea9b578ed54d7cb6a0fccb1a79ee433f43feb2a6858bf00f8fc19f8d55bef0237842f0
|
|
7
|
+
data.tar.gz: 90f49ebacb4bc8be03b27aa0b730aea8a4b6f6206a601e19cd7fdc6cfb56e23916dec63ae990ce05c525103afd29d2949b15e812d74662e53776dced970177f2
|
|
@@ -132,7 +132,14 @@ module Markbridge
|
|
|
132
132
|
private
|
|
133
133
|
|
|
134
134
|
def escape_text(text)
|
|
135
|
-
|
|
135
|
+
# On CRLF input, consume `\r` as part of the line terminator instead
|
|
136
|
+
# of leaving it on the line. A trailing `\r` breaks line-end anchored
|
|
137
|
+
# regexes (e.g. SETEXT_UNDERLINE_*) and the `ws_end >= line_length`
|
|
138
|
+
# early-out in escape_indented_code, leaking NBSPs onto
|
|
139
|
+
# whitespace-only CRLF lines. The `include?` guard keeps the
|
|
140
|
+
# LF-only fast path on a string split (regex split is ~20% slower
|
|
141
|
+
# on the indented-code hot path).
|
|
142
|
+
lines = text.include?("\r") ? text.split(/\r?\n/, -1) : text.split("\n", -1)
|
|
136
143
|
return escape_line(lines[0], false) if lines.size == 1
|
|
137
144
|
|
|
138
145
|
# Pre-allocate result buffer
|
data/lib/markbridge/version.rb
CHANGED