fix rich images

This commit is contained in:
Henry Jameson 2021-06-18 21:29:47 +03:00
parent b68fb7738b
commit 8fe4355a6b
2 changed files with 9 additions and 0 deletions

View file

@ -114,6 +114,8 @@ export const convertHtmlToLines = (html) => {
} else { } else {
handleOpen(tagFull) handleOpen(tagFull)
} }
} else {
textBuffer += tagFull
} }
} else { } else {
textBuffer += tagFull textBuffer += tagFull

View file

@ -69,6 +69,13 @@ describe('html_line_converter', () => {
const comparableResult = result.map(mapOnlyText(processorKeep)).join('') const comparableResult = result.map(mapOnlyText(processorKeep)).join('')
expect(comparableResult).to.eql(inputOutput) expect(comparableResult).to.eql(inputOutput)
}) })
it('fed with some recognized but not handled elements', () => {
const inputOutput = 'testing images\n\n<img src="benis.png">'
const result = convertHtmlToLines(inputOutput)
const comparableResult = result.map(mapOnlyText(processorKeep)).join('')
expect(comparableResult).to.eql(inputOutput)
})
}) })
describe('with processor that replaces lines with word "_" should match expected line when', () => { describe('with processor that replaces lines with word "_" should match expected line when', () => {
const processorReplace = (line) => '_' const processorReplace = (line) => '_'