1
0
mirror of https://github.com/laurent22/joplin.git synced 2024-11-24 08:12:24 +02:00

All: Regression: Fixed issue with style embeded in notes

This commit is contained in:
Laurent Cozic 2020-03-06 18:22:40 +00:00
parent 8ba9e9efd8
commit 972e5aed8a
5 changed files with 26 additions and 2 deletions

View File

@ -0,0 +1,6 @@
<style>
.md-checkbox input[type="checkbox"]:not(:checked),
.md-checkbox input[type="checkbox"]:not(:checked)+label {
display:none;
}
</style>

View File

@ -0,0 +1,6 @@
<style>
.md-checkbox input[type="checkbox"]:not(:checked),
.md-checkbox input[type="checkbox"]:not(:checked)+label {
display:none;
}
</style>

View File

@ -260,7 +260,9 @@ Joplin uses and renders a Github-flavoured Markdown with a few variations and ad
Rendered markdown can be customized by placing a userstyle file in the profile directory `~/.config/joplin-desktop/userstyle.css` (This path might be different on your device - check at the top of the Config screen for the exact path). This file supports standard CSS syntax. Joplin ***must*** be restarted for the new css to be applied, please ensure that Joplin is not closing to the tray, but is actually exiting. Note that this file is used for both displaying the notes and printing the notes. Be aware how the CSS may look printed (for example, printing white text over a black background is usually not wanted).
Editor styles can be customized by placing a custom editor style file in the profile directory `~/.config/joplin-desktop/userchrome.css`.
The whole UI can be customized by placing a custom editor style file in the profile directory `~/.config/joplin-desktop/userchrome.css`.
Important: userstyle.css and userchrome.css are provided for your convenience, but they are advanced settings, and styles you define may break from one version to the next. If you want to use them, please know that it might require regular development work from you to keep them working. The Joplin team cannot make a commitment to keep the application HTML structure stable.
# Note templates

View File

@ -104,7 +104,14 @@ class HtmlUtils {
ontext: (decodedText) => {
if (disallowedTags.includes(currentTag())) return;
output.push(htmlentities(decodedText));
if (currentTag() === 'style') {
// For CSS, we have to put the style as-is inside the tag because if we html-entities encode
// it, it's not going to work. But it's ok because JavaScript won't run within the style tag.
// Ideally CSS should be loaded from an external file.
output.push(decodedText);
} else {
output.push(htmlentities(decodedText));
}
},
onclosetag: (name) => {

View File

@ -454,6 +454,7 @@ class Setting extends BaseModel {
appTypes: ['desktop'],
label: () => _('Custom stylesheet for rendered Markdown'),
section: 'appearance',
advanced: true,
},
'style.customCss.joplinApp': {
onClick: () => {
@ -469,6 +470,8 @@ class Setting extends BaseModel {
appTypes: ['desktop'],
label: () => _('Custom stylesheet for Joplin-wide app styles'),
section: 'appearance',
advanced: true,
description: () => 'CSS file support is provided for your convenience, but they are advanced settings, and styles you define may break from one version to the next. If you want to use them, please know that it might require regular development work from you to keep them working. The Joplin team cannot make a commitment to keep the application HTML structure stable.',
},
autoUpdateEnabled: { value: true, type: Setting.TYPE_BOOL, section: 'application', public: true, appTypes: ['desktop'], label: () => _('Automatically update the application') },