Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: fix space removed after checkbox #2971

Merged
merged 2 commits into from Sep 6, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/Parser.ts
Expand Up @@ -141,11 +141,11 @@ export class _Parser {
} else {
item.tokens.unshift({
type: 'text',
text: checkbox
text: checkbox + ' '
} as Tokens.Text);
}
} else {
itemBody += checkbox;
itemBody += checkbox + ' ';
}
}

Expand Down
8 changes: 8 additions & 0 deletions test/unit/marked-spec.js
Expand Up @@ -33,6 +33,14 @@ describe('inlineLexer', () => {
});
});

describe('task', () => {
UziTech marked this conversation as resolved.
Show resolved Hide resolved
it('space after checkbox', () => {
const html = marked('- [ ] item');

expect(html).toBe('<ul>\n<li><input disabled="" type="checkbox"> item</li>\n</ul>\n');
});
});

describe('parseInline', () => {
it('should parse inline tokens', () => {
const md = '**strong** _em_';
Expand Down