Skip to content

Commit c7fc2df

Browse files
committed
refactor: drop the escapeApostrophes option
BREAKING CHANGE: not to escape apostrophes anymore
1 parent 931e355 commit c7fc2df

File tree

3 files changed

+1
-27
lines changed

3 files changed

+1
-27
lines changed

README.md

-7
Original file line numberDiff line numberDiff line change
@@ -127,13 +127,6 @@ will generate (`example.vue`):
127127
</script>
128128
```
129129

130-
### escapeApostrophes
131-
132-
- Type: `Boolean`
133-
- Default: `false`
134-
135-
Indicate if escape all apostrophes in html (`'` => `&apos;`) or not.
136-
137130
### exportSource
138131

139132
- Type: `Boolean`

src/index.js

+1-9
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ const path = require('path');
88
const defaultOptions = {
99
componentNamespace: 'component',
1010
componentWrapper: '',
11-
escapeApostrophes: false,
1211
exportSource: false,
1312
languages: ['vue', 'html'],
1413
markdownItOptions: {},
@@ -29,7 +28,6 @@ const defaultCheerioLoadOptions = {
2928
};
3029

3130
// RegExps
32-
const REGEXP_APOSTROPHES = /&apos;/g;
3331
const REGEXP_COMMENT_OPTIONS = /^(no-)?vue-component$/;
3432
const REGEXP_HYPHENS_END = /-*$/;
3533
const REGEXP_HYPHENS_START = /^-*/;
@@ -260,11 +258,5 @@ export default function markdownToVueLoader(source, map) {
260258
</script>`);
261259
}
262260

263-
let output = $html('body').html();
264-
265-
if (!options.escapeApostrophes) {
266-
output = output.replace(REGEXP_APOSTROPHES, '\'');
267-
}
268-
269-
this.callback(null, output, map);
261+
this.callback(null, $html('body').html(), map);
270262
}

test/index.js

-11
Original file line numberDiff line numberDiff line change
@@ -208,17 +208,6 @@ describe('markdown-to-vue-loader', () => {
208208
});
209209
});
210210

211-
it('escapeApostrophes', (done) => {
212-
bundle({
213-
entry: './test/fixtures/vue.md',
214-
}, (content) => {
215-
expect(content).to.contain('&apos;');
216-
done();
217-
}, {
218-
escapeApostrophes: true,
219-
});
220-
});
221-
222211
it('exportSource', (done) => {
223212
bundle({
224213
entry: './test/fixtures/vue.md',

0 commit comments

Comments
 (0)