aboutsummaryrefslogtreecommitdiff
path: root/test/unit
diff options
context:
space:
mode:
authorHenry Jameson <me@hjkos.com>2021-06-11 11:50:05 +0300
committerHenry Jameson <me@hjkos.com>2021-06-11 11:50:05 +0300
commit5834790d0b38d487e314e8419509d162abbd6a80 (patch)
tree858c53999b1ad9e2f6843360b37a02d33beab555 /test/unit
parentf819227bed8ab34e775ce5c0501457bf94c45fed (diff)
fix #935
Diffstat (limited to 'test/unit')
-rw-r--r--test/unit/specs/services/html_converter/html_line_converter.spec.js25
1 files changed, 25 insertions, 0 deletions
diff --git a/test/unit/specs/services/html_converter/html_line_converter.spec.js b/test/unit/specs/services/html_converter/html_line_converter.spec.js
index 82cb4170..532ea187 100644
--- a/test/unit/specs/services/html_converter/html_line_converter.spec.js
+++ b/test/unit/specs/services/html_converter/html_line_converter.spec.js
@@ -126,5 +126,30 @@ describe('TinyPostHTMLProcessor', () => {
const comparableResult = result.map(mapOnlyText(processorReplace)).join('')
expect(comparableResult).to.eql(output)
})
+
+ it('Testing handling ignored blocks', () => {
+ const input = `
+ <pre><code>&gt; rei = &quot;0&quot;
+ &#39;0&#39;
+ &gt; rei == 0
+ true
+ &gt; rei == null
+ false</code></pre><blockquote>That, christian-like JS diagram but it’s evangelion instead.</blockquote>
+ `
+ const result = convertHtmlToLines(input)
+ const comparableResult = result.map(mapOnlyText(processorReplace)).join('')
+ expect(comparableResult).to.eql(input)
+ })
+ it('Testing handling ignored blocks 2', () => {
+ const input = `
+ <blockquote>An SSL error has happened.</blockquote><p>Shakespeare</p>
+ `
+ const output = `
+ <blockquote>An SSL error has happened.</blockquote><p>_</p>
+ `
+ const result = convertHtmlToLines(input)
+ const comparableResult = result.map(mapOnlyText(processorReplace)).join('')
+ expect(comparableResult).to.eql(output)
+ })
})
})