Skip to content

Commit

Permalink
fix: support <s> tag (#76)
Browse files Browse the repository at this point in the history
  • Loading branch information
kptdobe committed Jan 23, 2023
1 parent 35d27cf commit 2691506
Show file tree
Hide file tree
Showing 5 changed files with 28 additions and 1 deletion.
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@
"node-fetch": "3.3.0",
"rehype-parse": "8.0.4",
"rehype-remark": "github:adobe-rnd/rehype-remark#45735e80a3d3c805d3c4211ae035f718ddd10bcb",
"remark-gfm": "3.0.1",
"remark-stringify": "10.0.2",
"unified": "10.1.2"
}
Expand Down
3 changes: 2 additions & 1 deletion src/importer/PageImporter.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import stringify from 'remark-stringify';
import fs from 'fs-extra';
import { md2docx } from '@adobe/helix-md2docx';
import remarkGridTable from '@adobe/remark-gridtables';
import { imageReferences } from '@adobe/helix-markdown-support';
import { imageReferences, remarkGfmNoLink } from '@adobe/helix-markdown-support';
import gridtableHandlers from './hast-to-mdast-gridtable-handlers.js';
import Utils from '../utils/Utils.js';
import DOMUtils from '../utils/DOMUtils.js';
Expand Down Expand Up @@ -84,6 +84,7 @@ export default class PageImporter {
})
.use(remarkImageReferences)
.use(remarkGridTable)
.use(remarkGfmNoLink)
.use(stringify, {
bullet: '-',
fence: '`',
Expand Down
4 changes: 4 additions & 0 deletions test/importers/PageImporter.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -177,4 +177,8 @@ describe('PageImporter tests - fixtures', () => {
it('import - spaces', async () => {
await featureTest('space');
});

it('import - strikethroughs', async () => {
await featureTest('s');
});
});
14 changes: 14 additions & 0 deletions test/importers/fixtures/s.spec.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<html>
<body>
<h1>strikethrough sample</h1>
<p><s>strikethrough 1</s></p>
<p>removed <del>strikethrough 2</del> but added <ins>insert 3</ins></p>
<p></p>
<p>
<b>
<s><span>US$84.99/mo</span></s>
<span>US$59.99/mo</span>&nbsp;per license
</b>
</p>
</body>
</html>
7 changes: 7 additions & 0 deletions test/importers/fixtures/s.spec.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# strikethrough sample

~~strikethrough 1~~

removed ~~strikethrough 2~~ but added insert 3

**~~US$84.99/mo~~ US$59.99/mo per license**

0 comments on commit 2691506

Please sign in to comment.