Skip to content

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

Open
wants to merge 7 commits into
base: master
Choose a base branch
from

Conversation

Truncated
Copy link

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!

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.
Copy link
Owner

@mProjectsCode mProjectsCode left a 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,
Copy link
Owner

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/>
Copy link
Owner

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants