KaraTemplater: Implement keeptags modifier#16
Open
Senyksia wants to merge 2 commits intoThe0x539:trunkfrom
Open
KaraTemplater: Implement keeptags modifier#16Senyksia wants to merge 2 commits intoThe0x539:trunkfrom
keeptags modifier#16Senyksia wants to merge 2 commits intoThe0x539:trunkfrom
Conversation
`keeptags` will preserve all non-k override tags at a character level. The modifier previously existed, but was unimplemented. Non-k override tags are now always matched during `preproc_chars`, and prepended to `char.text`. `keeptags` just flags for `char.text` to be used instead of the new `char.text_stripped` during `build_text`. BREAKING CHANGE: What was previously `char.text` has been renamed to `char.text_stripped`.
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
The
keeptagsmodifier flags that non-k override tags from an input line should be preserved when generating resultant output lines.The tags are extracted via
preproc_chars; we match for override blocks in asyl, map which character they belong to, and prepend the blocks tochar.text.Notably, this process is performed regardless of
keeptags.keeptagsmerely indicates if the output should be stripped or not.As
charpreviously only definedchar.text, I have renamed what waschar.texttochar.text_stripped, withchar.textnow representing the character including tags. This makes it consistent with the other classes, but will be potentially breaking for old component lines expectingchar.textto be stripped. An alternative could be storing tags inchar.tags, leavingchar.textuntouched. I prefer the consistent fields, but I'll RFC for now.A bug with
word.text_strippedis also indirectly fixed, which relied on an undefinedchar.text_stripped- causing the string to always benil.