-
Notifications
You must be signed in to change notification settings - Fork 327
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
Alternate \page{curlies} #4004
Alternate \page{curlies} #4004
Conversation
Using an empty inject breaks the syntax, which doesn't make much sense, allow for |
Fixed. |
Any final comments, @5e-Cleric , @dbolack-ab , @ericscheid ? |
Right now, when setting style for the first page, spaces are being allowed between page break and style inject, but not for other pages. Additionally, these spaces, while they don't break the regex for the inject, do break the syntax highlight. |
Also, class or id injection doesn't work for either ( |
Will update these as i go
|
|
Custom properties |
I see what is going on here... First page is the only one that might go into the Marked parser without being filtered through the page split regex first which wasn't allowing spaces. Ok. So to align with the other injector behavior, I should allow spaces in every case and fix the syntax highlighting to allow spaces too.
Good catch; somehow I deleted the class part when doing merges. Will put that back in. ID's are intentionally left out, else it would mess with page selection on the toolbar, etc.
Correct. This PR only applies to V3.
I see what happened. When I added the camelCase conversion it also converts |
Consistent behavior with other curly injections
@5e-Cleric I have fixed all of these cases you reported. Can you confirm? |
Can you clarify what steps result in the different order? As for testing, this just uses the same curly injection functions the rest of our markdown uses. The difference being we have to manually place the properties into a React component instead of just emitting the HTML output. So the parsing of the curlies is already tested. As far as testing that pages get the right properties, I'm not fully sure how we would go about testing HTML output from React. I am thinking we put it off for later unless you know of a good strategy. |
Interesting. I'm not sure how much control we have over the order React chooses here. Given that Page 1 is the only different one, my best guess is it has something to do with the very first "empty" render before any pages have been split and parsed, But this doesn't impact the behavior of the document at all so I don't know if it's worth hunting down. I think I will merge this and we can decide if its worth the effort to clean up the ordering later. |
Description
Takes #3899 and moves the handling of curlies back into Markdown.js. Small adjustments to regex, etc.
Opening as a new PR as I was getting too many merge conflicts to easily track. Note that these changes only apply to V3. Legacy should be unaffected.
Usage:
Similar to an inline single mustache.
\page{wide,banna=fail,color:black}
Related Issues or Discussions
Solves #3901
Reviewers, refer to this list when testing features, or suggest new items
<div class='page'>
instance.<div class='page'>
instance.<div class='page'>
instance.<div class='page'>
instance.line-height
) work (Page is a React component, which requires camelCase input)\page
on the first line of a document will not create a page break, and is counted as page 1\page
works without values.\page
still worksCopy the list here