Skip to content

Commit

Permalink
removed breaking change
Browse files Browse the repository at this point in the history
  • Loading branch information
luwol03 committed Jul 8, 2021
1 parent 4dd72b8 commit f3292d7
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions src/core/render/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ export function getAndRemoveConfig(str = '') {

if (str) {
str = str
.replace(/^"(:.*)"$/, '$1')
.replace(/^'(:.*)'$/, '$1')
.replace(/^"(.*)"$/, '$1')
.replace(/^'(.*)'$/, '$1')
.replace(/(?:^|\s):([\w-]+:?)=?([\w-%]+)?/g, (m, key, value) => {
if (key.indexOf(':') === -1) {
config[key] = (value && value.replace(/"/g, '')) || true;
Expand Down
6 changes: 3 additions & 3 deletions test/unit/render-util.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,13 +59,13 @@ describe('core/render/utils', () => {
});
});

test('dont parse quotes without colon', () => {
test('parse quotes without first colon', () => {
const result = getAndRemoveConfig(
`[filename](_media/example.md 'include')`
`[filename](_media/example.md 'include :foo=bar')`
);

expect(result).toMatchObject({
config: {},
config: { foo: 'bar' },
str: `[filename](_media/example.md 'include')`,
});
});
Expand Down

0 comments on commit f3292d7

Please sign in to comment.