Skip to content

Commit

Permalink
fix(list-item): dot is not escaped in ordered lists
Browse files Browse the repository at this point in the history
  • Loading branch information
skoropadas committed Jan 2, 2023
1 parent 9a54c1f commit c85b60c
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/telegramify.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ const createHandlers = definitions => ({
return wrap(value, marker);
},

listItem: (...args) => defaultHandlers.listItem(...args).replace(/^\*/, '•'),
listItem: (...args) => escapeSymbols(defaultHandlers.listItem(...args).replace(/^\*/, '•')),

code(node, _parent, context) {
const exit = context.enter('code');
Expand Down
2 changes: 1 addition & 1 deletion tests/convert.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ describe('Test convert method', () => {

it('Ordered list', () => {
const markdown = '1. list\n2. list\n3. list';
const tgMarkdown = '1. list\n2. list\n3. list\n';
const tgMarkdown = '1\\. list\n2\\. list\n3\\. list\n';
expect(convert(markdown)).toBe(tgMarkdown);
});

Expand Down

0 comments on commit c85b60c

Please sign in to comment.