scripts
scripts copied to clipboard
In Text-Highlights script is it possible to highlight in the editor?
Script name
Text Highlights
Script authors
@mleo2003 , @ryliejamesthomas
Expected behaviour
Text in editor is highlighted, and ==
on either side of text greyed like other **
and _
markdowns.
Actual behaviour
There does not appear to be any formatting applied.
Steps to reproduce
Install the Text Highlights script
Enter the following text in a note: This is a ==highlight== in the text but this is **bold** and this _italic_ !
Output from the debug section in the settings dialog
Relevant log output in the Log panel
You cannot script the editor highlighting, it's far too complex and optimized.
Is it possible to add ==highlight== as a built-in Markdown extension?
Is it possible to add ==highlight== as a built-in Markdown extension?
Why should that be added? 😅
It's a common and popular markdown extension. I realise markdown is the quintessential so many standards to choose from situation but this is one I've seen repeatedly and many people will probably expect. It is popular enough that someone has created a script to render it.
I've never seen it in the wild (where have you?) and if so, it even still it doesn't make a lot of sense to implement that into the highlighter, since not even md4c (the html generator for the preview) is supporting it and there already are "bold" and "italic".
Good afternoon
I first saw it in Notejoy but there's also:
- Typora
- Obsidian
- Quilt
- IA Writer
- Roam (^^ instead of == though)
Plus you support other non-standard/extensions like strike (~~) and tasks (- [ ]).
Thanks
-- Headed for the second star to the right and straight on 'til morning...
Eric Schultz
On Wed, Mar 30, 2022 at 11:44 AM Patrizio Bekerle @.***> wrote:
I've never seen it in the wild (where have you?) and if so, it even still it doesn't make a lot of sense to implement that into the highlighter, since not even md4c (the html generator for the preview) is supporting it and there already are "bold" and "italic".
— Reply to this email directly, view it on GitHub https://github.com/qownnotes/scripts/issues/165#issuecomment-1083308196, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAAHRF7FYQLTAODTNBVGFPLVCRZEFANCNFSM5R45HANQ . You are receiving this because you authored the thread.Message ID: @.***>
even still it doesn't make a lot of sense to implement that into the highlighter, since not even md4c (the html generator for the preview) is supporting it and there already are "bold" and "italic".
It does render a highlight in the preview.
I would also find this useful, as currently I mostly use QON with the preview pane hidden.
I would also find this useful, as currently I mostly use QON with the preview pane hidden.
You should be able to do it with a very simple script such as this one:
import QtQml 2.0
import QOwnNotesTypes 1.0
QtObject {
function init() {
script.addHighlightingRule("==([^=]*)?==", "", 8, 1, -1);
}
}
Or adding script.addHighlightingRule("==([^=]*)?==", "", 8, 1, -1);
in the init of https://github.com/qownnotes/scripts/blob/master/text-highlights/text-highlights.qml#L37
I think this issue is closed with https://github.com/qownnotes/scripts/commit/8a48f39afbe11a3c7eb35967e11f414a201aac3b