BREAKING CHANGES. Re-wrote the whole library. Corrected a lot of mistakes I made when I first wrote it.
Closes #1, as I think its better to handle TG markdown in the plugin itself. Not in this library.
A lot have been changed:
Changelog
Switched to marked from marky for parsing Markdown to HTML.
Removed parseMarkdown and parseHTML in favor of a common method parse which takes two arguments: content and parse mode. (Closes #4 as it also tries to solve this in a different way)
2.0
BREAKING CHANGES. Re-wrote the whole library. Corrected a lot of mistakes I made when I first wrote it.
Closes #1, as I think its better to handle TG markdown in the plugin itself. Not in this library.
A lot have been changed:
Changelog
Switched to marked from marky for parsing Markdown to HTML.
Removed
parseMarkdown
andparseHTML
in favor of a common methodparse
which takes two arguments: content and parse mode. (Closes #4 as it also tries to solve this in a different way)Removed
setupAccount
method and the abilities to create or edit account directly by passing it to the constructor. I think the new API is much clean.upload
function was improved.Supports installing an error handler to catch and manage errors as you like. (Thanks to grammyjs/grammY)
Types have been improved.
iframe URLs are no longer transformed like it used to do. Now it only appends the URI encoded URL to
/embed/{}?url={}
after validation.HTML is sanitized before parsing.
Line breaks have been improved.
docs: API reference documentation is copied to the code. So, users can have documentation right in their editor. Closes #2
3 is still pending and need to be worked on before merging this.