diff --git a/test/unit/helpers/helpers.spec.js b/test/unit/helpers/helpers.spec.js index c57cb8d..ea1eaef 100644 --- a/test/unit/helpers/helpers.spec.js +++ b/test/unit/helpers/helpers.spec.js @@ -121,5 +121,47 @@ let variable = 2; expect(block.content).is.eq('\nlet variable = 2;\n'); expect(block.attributes).is.empty; }); + + // TODO Re-enable for following issue: https://github.com/alexprey/sveltedoc-parser/issues/58 + xit('When html block contains complex markup with escaping and string usages should provide a correct result', () => { + const content = ` + + + +

+ Active tab: {activeTab1[0].title} +
+
+ + + {@html highlight( + ' \n\n' + + '')} + +
+ `; + + const result = helpers.extractAllHtmlBlocks(content, 'script'); + + expect(result).is.exist; + expect(result.blocks).is.exist; + expect(result.blocks.length).is.eq(1); + + const block = result.blocks[0]; + + expect(block).is.exist; + expect(block.offset).is.eq(9); + expect(block.content).is.eq('\nexport let items = [];\n'); + expect(block.attributes).is.empty; + }); }); });