-
-
Notifications
You must be signed in to change notification settings - Fork 11
Added Word Wrap as a global setting and some formatting to the Settings page #9
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
base: master
Are you sure you want to change the base?
Conversation
updated with wrap tests at bottom
added word wrap global setting and formatting
Added word wrap global setting
Added word-wrap from global settings value.
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.
Looks good, but I marked some minor things.
@@ -138,6 +138,7 @@ export default class ShikiPlugin extends Plugin { | |||
themeCssRoot: 'div.expressive-code', | |||
defaultProps: { | |||
showLineNumbers: false, | |||
wrap: this.settings.wrapGlobal, |
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.
For consistency, you should probably access this.loadedSettings
instead.
// Theme | ||
const ThemeDesc = new DocumentFragment() | ||
ThemeDesc.createSpan({}, span => { | ||
span.innerHTML = `Select the theme for the code blocks.<br/> |
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.
Don't use innerHTML, even if it is a "secure" string.
Thank you for the plugin!
I added a little bit of formatting to the settings page so that it's easy to keep consistent if you ever want to expand the values quickly.
I added a global word wrap variable to toggle on/off in settings and apply as appropriate. I tested that the in-line settings will override as well.
The default is word-wrap on, but you may wish to make that false by default. :)
Cheers!