-
Notifications
You must be signed in to change notification settings - Fork 279
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
rework RTF/CRE code #1364
rework RTF/CRE code #1364
Conversation
lambda: ('{^\n\n^}{-|}', r'{\cxds \par \cxds}\cxfc '), | ||
# Plover custom formatting: | ||
# - meta: command | ||
lambda: ('{PLOVER:TOGGLE}', r'{\*\cxplovermeta PLOVER:TOGGLE}'), |
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.
\cxplovercommand
maybe? and the PLOVER:
is redundant here.
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.
No, the goal is to avoid the need for a specific control word for each feature supported by metas, so only one general \cxplovermeta
control word, with the content.
# - meta: command | ||
lambda: ('{PLOVER:TOGGLE}', r'{\*\cxplovermeta PLOVER:TOGGLE}'), | ||
# - meta: key combo | ||
lambda: ('{#Return}', r'{\*\cxplovermeta #Return}'), |
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.
\cxploverkeycombo
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.
Ditto.
d63a958
to
12d190e
Compare
I forgot to mention there's one xfailed test left: # Why not 'eclipse command'?
lambda: rtf_load_test('{eclipse command}', '{eclipse command}', xfail=True), Which has the comment mention does not make sense: |
I don't see any issue. (although I don't really use RTF) Notes:
|
12d190e
to
3c9f9e6
Compare
Good point, done.
Yeah, no, saving in Plover is always going to be a destructive operation: between the unsupported control groups/words, the fact that they can stack, the mostly ignored header part of the RTF (stylesheet...).
I'll see if I can merge those tests with the save ones (which include a round-trip check). |
- correctly escape special characters - properly handle multiple formatting atoms
Use a custom ignored group to handle Plover' specific metas.
By using groups so they can be parsed back correctly.
3c9f9e6
to
9aa69e5
Compare
Perfect roundtrip is not always possible, e.g.: And there are corresponding load tests for checking the conversion in the other direction, so I'm gonna leave it as is, except I added support for |
88f6ced
to
8ad89bd
Compare
Summary of changes
New parser:
\n\n
for new paragraphs (instead of non-undoable{#Return}{#Returns}
)\t
and\n
for\tab
and\line
plover_stroke
#1362)New save code:
{}\
{^in^}fix
->{\cxds in \cxds}fix
instead of\cxds in\cxds fix
)Closes #209, #589, #773, #1128.
Pull Request Checklist