-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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: serialize AST node back to wikitext string #8258
Open
linonetwo
wants to merge
55
commits into
TiddlyWiki:master
Choose a base branch
from
linonetwo:feat/to-string
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 6 commits
Commits
Show all changes
55 commits
Select commit
Hold shift + click to select a range
37338b1
refactor: extract a new $tw.wiki.getParser
linonetwo 8a12498
feat: allow $tw.utils.getParseTreeText to render other rules' text
linonetwo 09c2e71
feat: two example getText handler
linonetwo a0708a1
Revert "feat: allow $tw.utils.getParseTreeText to render other rules'…
linonetwo f882cbd
refactor: keep original getParseTreeText not touched
linonetwo be3f037
refactor: use serialize in rules
linonetwo 4ddcbc6
Merge remote-tracking branch 'upstream/master' into feat/to-string
linonetwo 4e896d1
refactor: $tw.utils.extend({},options) -> options || {}
linonetwo 179651a
Update codeinline.js
linonetwo 8cbf855
Create test-wikitext-serialize.js
linonetwo a075303
DEBUG: only run my tests for development, remove before PR merge
linonetwo 05dec72
lint: if
linonetwo 1a6a071
feat: add rule: 'parseBlock' metadata
linonetwo 84e27c0
feat: handle tailing \n that may be missing
linonetwo 078967c
feat: allow recursive
linonetwo 2aff9fe
feat: generate more rule and tests
linonetwo bfd116a
feat: generate more rule and tests
linonetwo d067871
fix: remove pragma:true, otherwise following text will become childre…
linonetwo b1667ec
fix: condition manually
linonetwo e49238d
fix: some test
linonetwo 383e1b6
fix: some test
linonetwo 63613ce
feat: $tw.utils.serializeAttribute
linonetwo 7b4ea47
fix: use "" for string param
linonetwo f69795c
feat: list
linonetwo 9df36a2
refactor: ' -> "
linonetwo 2a75077
fix: parsemode don't have node
linonetwo c392976
fix: render invisible comment and parsemode as data element
linonetwo b22ca2b
feat: add void: true, in ast node to prevent render
linonetwo 96adee9
Merge branch 'TiddlyWiki:master' into feat/to-string
linonetwo 5b2c3db
feat: use void widget, so methods always return a widget
linonetwo 7bc408b
feat: ast to use new widget type void
linonetwo 82ae767
test: add rule: 'parseBlock' and isRuleEnd: true
linonetwo 893edf9
lint: quote
linonetwo d6b9d00
Update widget.js
linonetwo 6ac9592
fix: void node need to handle its children
linonetwo 9dbbcef
Update test-wikitext-parser.js
linonetwo e7d4819
lint: quote
linonetwo af2ddaa
Update void.js
linonetwo b8125d1
Update test-wikitext-parser.js
linonetwo 2fa454a
fix: macrodef with comment (void node) not working
linonetwo fb8732a
lint: ' -> "
linonetwo 078cd5f
feat: add to styleblock
linonetwo 7c73f1f
feat: styleblock
linonetwo 43f3f8b
feat: styleinline
linonetwo 856cb42
Update table.js
linonetwo 3cf93d0
lint: useless comments
linonetwo 589241a
feat: transcludeblock
linonetwo 0adf638
refactor: reuse block on inline when possible
linonetwo c4f6136
feat: use void node to carry important info for typedblock
linonetwo 08e9312
feat: run all tests
linonetwo 398d7f7
lint: useless ai generated comments
linonetwo 6580536
Merge remote-tracking branch 'upstream/master' into feat/to-string
linonetwo f5fca2a
Update conditional.js to not include space
linonetwo 043f60b
Update test-wikitext-serialize.js
linonetwo 03798d7
Update conditional.js
linonetwo File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IMO your code will throw an RSOD if options is undefined
So
options = options || {}
should be used instead. We use this pattern all over the places.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I copy
$tw.utils.extend({},options)
from somewhere nearby, I thought this will work.