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

feat: Custom Tokenizer/Renderer extensions #2043

Merged
merged 49 commits into from
Jun 15, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
49 commits
Select commit Hold shift + click to select a range
04fef1b
Initial Commit
calculuschild May 8, 2021
108d4bc
Paragraph Tokenizer handles custom "start" points for extensions
calculuschild May 8, 2021
ee563e1
Move "start" logic from Paragraph tokenizer to Lexer
calculuschild May 8, 2021
a0798c3
Clear extensions after each "Use Extension" unit test
calculuschild May 8, 2021
1308bc3
Unit test: require blank lines for custom block tokens if not using "…
calculuschild May 8, 2021
803bbac
Handle inline tokens
calculuschild May 9, 2021
94befe4
Put extensions in map to prevent looping
calculuschild May 11, 2021
f4c2b44
Remove 'overwrite' keyword / copied runTokenizerExtension between all…
calculuschild May 11, 2021
e7da3a0
Typo
calculuschild May 11, 2021
87ade7e
Another Typo
calculuschild May 11, 2021
244e07f
Run all Tokenizer extensions at top of Lexer loop / remove "before"
calculuschild May 12, 2021
b107826
Add unit test showing interacting block and inline extensions
calculuschild May 13, 2021
47538e9
Remove TokenParsed from Parser.js
calculuschild May 13, 2021
31b7fa5
Better Paragraph interruption
calculuschild May 14, 2021
a03a64f
Lint
calculuschild May 14, 2021
16fc409
Put renderers in its own property
calculuschild May 14, 2021
15be918
Unit test for custom renderer that returns false.
calculuschild May 14, 2021
0cb670e
Make 'start' rules into functions.
calculuschild May 14, 2021
6ec699e
Extensions can use lexer and parser functions
calculuschild May 15, 2021
cc23bc9
add walkableTokens property to extensions
calculuschild May 15, 2021
375255e
Add `walkableTokens` option for extensions.
calculuschild May 15, 2021
b602e71
walkable Tokens requires options passed in
calculuschild May 19, 2021
9c9c557
Update src/marked.js
calculuschild May 18, 2021
eccaff4
Update src/marked.js
calculuschild May 18, 2021
adace8c
lint
calculuschild May 19, 2021
7fafa71
Update unit test functions to object method syntax
calculuschild May 19, 2021
e993545
walktokens uses marked.defaults instead of opts parameter
calculuschild May 19, 2021
95ceb59
Change hasExtensions to a boolean
calculuschild May 19, 2021
70d3e2b
Don't walk .tokens param if defined in the extension
calculuschild May 19, 2021
892ef65
Update Lexer.js
calculuschild May 19, 2021
fa7aaca
add multiple extension test
UziTech May 19, 2021
ec85ef3
Update src/marked.js
calculuschild May 19, 2021
8a25d94
Fix multiple extensions overwriting each other
calculuschild May 20, 2021
d8bbb74
Rebase
calculuschild May 20, 2021
e6b4bbd
Update src/marked.js
calculuschild May 20, 2021
d9ec74d
Small fixes
calculuschild May 20, 2021
caab77b
Change walkableTokens to childTokens
calculuschild May 21, 2021
ac35030
Unit test that shows working "style tag" type syntax
calculuschild May 21, 2021
eb0e790
Last loaded extension gets priority, but will fall back to next exten…
calculuschild May 22, 2021
ccb9869
Cleanup
calculuschild May 22, 2021
bbc8685
Errors for missing name or invalid 'level'
calculuschild May 22, 2021
ecc47d4
override original tokenizer/renderer with same name, but fall back if…
calculuschild May 22, 2021
c175894
test fallback if returning false in extension
UziTech May 31, 2021
697315a
Update Docs, first pass
calculuschild Jun 1, 2021
dc828a0
Formatting changes to docs
calculuschild Jun 1, 2021
00a91cc
Update docs/USING_PRO.md
calculuschild Jun 1, 2021
9eb1aa8
Change marked.use to accept multiple parameters instead of an array
calculuschild Jun 2, 2021
4c9b38f
Merge branch 'MarkedExtensions' of https://github.com/calculuschild/m…
calculuschild Jun 2, 2021
0664ddd
update docs
calculuschild Jun 2, 2021
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
333 changes: 268 additions & 65 deletions docs/USING_PRO.md

Large diffs are not rendered by default.