diff --git a/text-highlights/info.json b/text-highlights/info.json index 5241571..032e3cb 100644 --- a/text-highlights/info.json +++ b/text-highlights/info.json @@ -2,9 +2,9 @@ "name": "Text Highlights", "identifier": "text-highlights", "script": "text-highlights.qml", - "authors": ["@mleo2003"], + "authors": ["@mleo2003", "@ryliejamesthomas"], "platforms": ["linux", "macos", "windows"], - "version": "0.0.2", + "version": "0.0.3", "minAppVersion": "17.06.2", "description" : "Provide a way to highlight text in markdown and render it as some other markdown viewers do. Uses ==text== syntax, and the color shown is configurable." } diff --git a/text-highlights/text-highlights.qml b/text-highlights/text-highlights.qml index 30196b0..74c5ad6 100644 --- a/text-highlights/text-highlights.qml +++ b/text-highlights/text-highlights.qml @@ -2,29 +2,29 @@ import QtQml 2.0 import QOwnNotesTypes 1.0 QtObject { - property string highlightColor; - + property string backgroundColor; + property variant settingsVariables: [ { - "identifier": "highlightColor", + "identifier": "backgroundColor", "name": "Highlight Color", - "description": "Color to highlight text as", + "description": "Color to highlight text with (name or #hex):", "type": "string", - "default": "FFFF00", + "default": "#FFFF00", } ]; function noteToMarkdownHtmlHook(note, html) { - var stylesheet = ".highlighted {background-color: #" + highlightColor + ";}"; - html = html.replace(/==(.+?)==/g, "$1"); + var stylesheet = "mark {background-color:" + backgroundColor + ";}"; + html = html.replace(/==(.+?)==/g, "$1"); html = html.replace("", stylesheet + ""); return html; } - + function init() { script.registerCustomAction("addHighlights", "Add Highlight Marks", "Add Highlights", "text-wrap"); } - + function customActionInvoked(identifier) { switch (identifier) { case "addHighlights":