-
-
Notifications
You must be signed in to change notification settings - Fork 223
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
"Apply these styles to page" does not work for "code" style #1543
Comments
Was your custom Code style based on the default code style, and then customized? Is the name of your custom style either "code" or "source code"? Here's an animated GIF showing OneMore 6.5 applying styles including a custom "Code" style based on the default code style, using a different font and color. Since my style was based on the default code style, it still indicates in the OneNote style dropdown that it is code, however it has applied my custom styling to it as well. |
Apologies, this is so strange. I can´t reproduce it now 🫢 Will try some more. I use default settings for OneMore styles. I may have noticed another bug though. If I tag a text with the "code" style and then apply the OneMore styles to the page, the formatting of the text changes to the OneMore code style, but the "code" tag is removed from the text when I check the default styles. Headers, on the other hand, work as I would expect. For example, if I tag a text with the "header 1" tag and then apply the OneMore styles to the complete page, the text is still tagged as "header 1" but the formatting is set based on the OneMore header 1 style. |
I can't seem to reproduce that code style mapping issue. |
I am hitting this now, I've recorded a video reproduction. If I set the OneMore's "Code" style, it loses OneNote's "Code" classification. Subsequently, "Apply styles to this page" removes the monospaced font because it thinks it's "Normal" text with a monospaced font. But if I set the "Code" style using OneNote's button, it keeps the "Code" classification, and OneMore's "Apply styles to this page" does not break it. Ignore the printer dialog; I got the Ctrl+, hotkey mixed up and accidentally pressed Ctrl+P 2024-10-19.12-29-31.mp4I also noticed that the "Code" style in OneMore does not fully erase the "Quote" style from OneMore. 2024-10-19.12-34-46.mp4I hope this is helpful! Let me know if there's more I can do to help reproduce. |
I learned about Ctrl+Alt+Shift+X and did another experiment, inspecting the XML after each edit. I also learned a lot from OneMore's excellent developer docs. I think this is related to https://onemoreaddin.com/developers/TechNote%20-%20Styles.htm
I believe the fix is for OneMore's custom style "Code" to have
My hunch is, when you "Apply These Styles to Page", OneMore modifies each But when you apply an individual OneMore style to a line, OneMore writes a new Reproduction
For OneMore's code style, |
Your analysis is exactly right. It does need to use the built-in "code" quickstyle. OneNote allows multiple definitions of each quickstyle so that would work. And it would need its own Style Type in the OneMOre edit styles dialog box, "Code - entire paragraph". Unfortunately, the code quickstyle can only apply to and entire paragraph, not an inline text run. The OneMore style definition library XML files would each need updating with an upgrade reader-makes-right path. |
This ticket blocks #1612 |
Problem to Solve
The feature "Apply style to page" should apply all styles that can be mapped to any of the OneNote default styles. It works great for headers, but it does not work for the "code" style.
To Reproduce
Expected Behavior
Applying the styles to a page should change the text tagged as "code" to the style defined in the OneMore add-on.
Screenshots
n/a
Environment (if applicable)
Additional Context
The text was updated successfully, but these errors were encountered: