Tony Brix
042dcc5431
fix: always return promise if async ( #2728 )
...
* fix: always return promise if async
* docs: await walktokens when async
* docs: walktokens async
Co-authored-by: Steven <steven@ceriously.com>
* return rejected promise on error
---------
Co-authored-by: Steven <steven@ceriously.com>
2023-03-21 19:51:45 -05:00
Tony Brix
73a7bf5cd9
fix: fix marked.use with multiple args ( #2651 )
...
Fixes undefined
2022-11-20 10:06:28 -06:00
Tony Brix
994b2e6127
feat: add async option ( #2474 )
...
* fix: return values from walkTokens
* docs: add async docs
* test: add async test
* docs: add nav to async
* Update docs/USING_PRO.md
Co-authored-by: Steven <steven@ceriously.com>
* test: expect promise
* Update docs/USING_ADVANCED.md
Co-authored-by: Steven <steven@ceriously.com>
Co-authored-by: Steven <steven@ceriously.com>
2022-08-30 09:36:16 -05:00
Tony Brix
f1a9608201
fix: make second parameter optional on lexer.inline ( #2552 )
...
* fix: make second parameter optional on lexer.inline
* return tokens
* add test
2022-08-21 11:21:11 -05:00
Phillip Burch
a9696e2898
fix: retain line breaks in tokens properly ( #2341 )
...
* Fix lexer and tokenizer to retain line breaks properly
* Add test for bug
* Check for line breaks not just spaces
* Fix lint
* Fix spacing in test
* clean up code
Co-authored-by: Tony Brix <tony@brix.ninja>
2022-01-06 09:31:58 -06:00
Ben McCann
4afb228d95
fix: Convert to ESM ( #2227 )
...
BREAKING CHANGE:
- Default export removed. Use `import { marked } from 'marked'` or `const { marked } = require('marked')` instead.
- `/lib/marked.js` removed. Use `/marked.min.js` in script tag instead.
- When using marked in a script tag use `marked.parse(...)` instead of `marked(...)`
2021-11-02 09:32:17 -05:00
Tony Brix
2da5885989
fix: walkTokens uses marked as this ( #2251 )
2021-10-24 00:03:59 -05:00
Trevor Buckner
eb33d3b3a9
fix: Full Commonmark compliance for Lists ( #2112 )
2021-08-09 22:41:45 -05:00
Trevor Buckner
288f1cbe2f
Tokenizers lex their own child tokens ( #2124 )
...
BREAKING CHANGES:
- Tokenizers will create their own tokens with `this.lexer.inline(text, tokens)`. The `inline` function will queue the token creation until after all block tokens are rendered.
- `nptable` tokenizer is removed and merged with `table` tokenizer.
- Extensions tokenizer `this` object will include the `lexer` as a property. `this.inlineTokens` becomes `this.lexer.inline`.
- Extensions parser `this` object will include the `parser` as a property. `this.parseInline` becomes `this.parser.parseInline`.
- `tag` and `inlineText` tokenizer function signatures have changed.
2021-08-02 14:12:43 -05:00
Tony Brix
af14068b99
fix: fix node v12 ( #2109 )
2021-06-16 08:48:39 -05:00
Trevor Buckner
5be9d6d70e
feat: Custom Tokenizer/Renderer extensions ( #2043 )
...
Co-authored-by: Tony Brix <tony@brix.ninja>
2021-06-15 18:22:00 -05:00
Tony Brix
1d973084ab
fix: call walkTokens when calling marked with a callback( #2060 )
2021-05-21 15:53:01 -05:00
Tony Brix
46cdfc1ece
fix: fix items between lists ( #1936 )
2021-02-26 23:51:21 -06:00
Tony Brix
53c79ee919
fix: leave whitespace only lines alone ( #1889 )
...
* fix: leave whitespace only lines alone
* test: add whitepace_lines test
* fix: render code with trailing new line
2021-01-26 08:20:13 -06:00
Tony Brix
c8a2b59d83
remove focused tests
2020-09-21 00:21:56 -05:00
Tony Brix
baece60557
test marked.parseInline
2020-09-20 23:01:11 -05:00
flouc001
75b2646687
add sequence test
2020-07-15 08:16:03 +01:00
Callum
014fbcf43f
add assertion to existing test
...
Co-authored-by: Tony Brix <tony@brix.ninja>
2020-07-15 08:03:31 +01:00
flouc001
710658cb61
use options param, update docs, update tests
2020-07-12 19:38:37 +01:00
flouc001
7c35a842a6
add dry run capabilities to default slugger
2020-07-11 09:24:46 +01:00
Tony Brix
0233262d76
fix async highlight sync
2020-05-21 10:26:48 -05:00
Tony Brix
267a176c9a
add use walkTokens tests
2020-05-12 19:57:27 -05:00
Tony Brix
a337c76ff6
add walkTokens option
2020-05-12 19:57:27 -05:00
Tony Brix
db3b61bcc9
add tests
2020-05-12 19:57:27 -05:00
Tony Brix
07f2b334f0
return false to use last renderer/tokenizer
2020-04-19 01:08:54 -05:00
Tony Brix
dd86b714a3
add marked.use tests
2020-04-19 00:04:06 -05:00
Tony Brix
4d24272617
add tests
2020-04-02 00:24:21 -05:00
Tony Brix
11656f8bd4
add inline html test
2020-02-12 00:24:43 -06:00
Tony Brix
630aaa65b5
add test
2019-12-05 11:45:07 -06:00
Tony Brix
ba45b32dd7
remove test:redos and use es6 in tests
2019-11-06 12:15:12 -06:00
Tony Brix
d9f22d2726
separate eslint config
2019-05-03 20:59:43 -05:00
Tony Brix
fb9a71ccf1
use arrow functions
2019-03-12 09:32:45 -05:00
Steven
632ac5d55d
Fix unit tests for slugger
2018-12-21 15:51:05 -08:00
Steven
5c926e227b
Fix slugger & unit tests
2018-12-21 15:23:33 -08:00
Steven
08d9632bdf
Fix duplicate heading id
2018-12-20 16:07:10 -05:00
Tony Brix
484deb51fc
move to unit test
2018-05-02 09:13:58 -05:00
Tony Brix
25c456a5e7
lint
2018-04-05 00:00:37 -05:00
Josh Bruce
8804676f98
Disable heading IDs ( #1190 )
...
* Add option to disable heading ids
* Alphabetize and add options to docs
2018-04-03 15:10:26 -04:00
Tony Brix
79325aa9e1
add tests
2018-03-04 00:47:02 -06:00
Tony Brix
dce66a2849
add first test
2018-03-03 21:33:02 -06:00