Skip to content

Commit 6387c8e

Browse files
committed
lint: format all files
Signed-off-by: Patrizio Bekerle <patrizio@bekerle.com>
1 parent b30c698 commit 6387c8e

5 files changed

Lines changed: 15814 additions & 55 deletions

File tree

journal-entry/journal-entry.qml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,8 @@ import com.qownnotes.noteapi 1.0
77
*/
88
QtObject {
99
id: journalEntry
10-
readonly property variant _SHORT_DAYS_EN: ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"]
11-
1210

11+
readonly property variant _SHORT_DAYS_EN: ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"]
1312
property string defaultFolder
1413
property string defaultTags
1514
property var dialog

markdown-it/info.json

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,11 @@
22
"name": "Markdown-it markdown parser",
33
"identifier": "markdown-it",
44
"script": "markdown-it.qml",
5-
"resources": ["markdown-it.js", "markdown-it-deflist.js", "markdown-it-katex.js"],
5+
"resources": [
6+
"markdown-it.js",
7+
"markdown-it-deflist.js",
8+
"markdown-it-katex.js"
9+
],
610
"authors": ["@milan-rusev", "@bessw", "@cjendantix"],
711
"version": "1.5",
812
"minAppVersion": "20.6.0",

markdown-it/markdown-it-katex.js

Lines changed: 15759 additions & 1 deletion
Large diffs are not rendered by default.

markdown-it/markdown-it.qml

Lines changed: 47 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -8,31 +8,36 @@ QtObject {
88
property string customStylesheet
99
property variant md
1010
property string options
11-
property variant settingsVariables: [{
12-
"identifier": "options",
13-
"name": "Markdown-it options",
14-
"description": "For available options and default values see <a href='https://github.com/markdown-it/markdown-it/blob/master/lib/presets'>markdown-it presets</a>.",
15-
"type": "text",
16-
"default": "{" + "\n" + " //html: false, // Enable HTML tags in source" + "\n" + " //xhtmlOut: false, // Use '/' to close single tags (<br />)" + "\n" + " //breaks: false, // Convert '\\n' in paragraphs into <br>" + "\n" + " //langPrefix: 'language-', // CSS language prefix for fenced blocks" + "\n" + " //linkify: false, // autoconvert URL-like texts to links" + "\n" + "" + "\n" + " // Enable some language-neutral replacements + quotes beautification" + "\n" + " //typographer: false," + "\n" + "" + "\n" + " // Double + single quotes replacement pairs, when typographer enabled," + "\n" + " // and smartquotes on. Could be either a String or an Array." + "\n" + " //" + "\n" + " // For example, you can use '«»„“' for Russian, '„“‚‘' for German," + "\n" + " // and ['«\\xA0', '\\xA0»', '‹\\xA0', '\\xA0›'] for French (including nbsp)." + "\n" + " //quotes: '\\u201c\\u201d\\u2018\\u2019', /* “”‘’ */" + "\n" + "" + "\n" + " // Highlighter function. Should return escaped HTML," + "\n" + " // or '' if the source string is not changed and should be escaped externaly." + "\n" + " // If result starts with <pre... internal wrapper is skipped." + "\n" + " //" + "\n" + " // function (/*str, lang*/) { return ''; }" + "\n" + " //" + "\n" + " //highlight: null," + "\n" + "" + "\n" + " //maxNesting: 100 // Internal protection, recursion limit" + "\n" + "}"
17-
}, {
18-
"identifier": "useDeflistPlugin",
19-
"name": "Definition lists",
20-
"text": "Enable the Markdown-it definition list (<dl>) plugin",
21-
"type": "boolean",
22-
"default": false
23-
}, {
24-
"identifier": "useKatexPlugin",
25-
"name": "LaTeX Support",
26-
"text": "Enable the Markdown-it definition list KaTeX plugin",
27-
"type": "boolean",
28-
"default": false
29-
}, {
30-
"identifier": "customStylesheet",
31-
"name": "Custom stylesheet",
32-
"description": "Please enter your custom stylesheet:",
33-
"type": "text",
34-
"default": null
35-
}]
11+
property variant settingsVariables: [
12+
{
13+
"identifier": "options",
14+
"name": "Markdown-it options",
15+
"description": "For available options and default values see <a href='https://github.com/markdown-it/markdown-it/blob/master/lib/presets'>markdown-it presets</a>.",
16+
"type": "text",
17+
"default": "{" + "\n" + " //html: false, // Enable HTML tags in source" + "\n" + " //xhtmlOut: false, // Use '/' to close single tags (<br />)" + "\n" + " //breaks: false, // Convert '\\n' in paragraphs into <br>" + "\n" + " //langPrefix: 'language-', // CSS language prefix for fenced blocks" + "\n" + " //linkify: false, // autoconvert URL-like texts to links" + "\n" + "" + "\n" + " // Enable some language-neutral replacements + quotes beautification" + "\n" + " //typographer: false," + "\n" + "" + "\n" + " // Double + single quotes replacement pairs, when typographer enabled," + "\n" + " // and smartquotes on. Could be either a String or an Array." + "\n" + " //" + "\n" + " // For example, you can use '«»„“' for Russian, '„“‚‘' for German," + "\n" + " // and ['«\\xA0', '\\xA0»', '‹\\xA0', '\\xA0›'] for French (including nbsp)." + "\n" + " //quotes: '\\u201c\\u201d\\u2018\\u2019', /* “”‘’ */" + "\n" + "" + "\n" + " // Highlighter function. Should return escaped HTML," + "\n" + " // or '' if the source string is not changed and should be escaped externaly." + "\n" + " // If result starts with <pre... internal wrapper is skipped." + "\n" + " //" + "\n" + " // function (/*str, lang*/) { return ''; }" + "\n" + " //" + "\n" + " //highlight: null," + "\n" + "" + "\n" + " //maxNesting: 100 // Internal protection, recursion limit" + "\n" + "}"
18+
},
19+
{
20+
"identifier": "useDeflistPlugin",
21+
"name": "Definition lists",
22+
"text": "Enable the Markdown-it definition list (<dl>) plugin",
23+
"type": "boolean",
24+
"default": false
25+
},
26+
{
27+
"identifier": "useKatexPlugin",
28+
"name": "LaTeX Support",
29+
"text": "Enable the Markdown-it definition list KaTeX plugin",
30+
"type": "boolean",
31+
"default": false
32+
},
33+
{
34+
"identifier": "customStylesheet",
35+
"name": "Custom stylesheet",
36+
"description": "Please enter your custom stylesheet:",
37+
"type": "text",
38+
"default": null
39+
}
40+
]
3641
property bool useDeflistPlugin
3742
property bool useKatexPlugin
3843

@@ -44,41 +49,26 @@ QtObject {
4449

4550
if (useKatexPlugin)
4651
this.markdownItKatex(md, {
47-
"output": "mathml"
48-
});
52+
"output": "mathml"
53+
});
4954

5055
//Allow file:// url scheme
5156
var validateLinkOrig = md.validateLink;
5257
var GOOD_PROTO_RE = /^(file):/;
53-
md.validateLink = function(url) {
58+
md.validateLink = function (url) {
5459
var str = url.trim().toLowerCase();
5560
return GOOD_PROTO_RE.test(str) ? true : validateLinkOrig(url);
5661
};
5762
}
58-
59-
function resolvePath(base, relative) {
60-
const baseParts = base.replace(/\/+$/, '').split('/');
61-
const relParts = relative.replace(/^\.\/+/, '').split('/');
62-
for (const part of relParts) {
63-
if (part === '..')
64-
baseParts.pop();
65-
else if (part !== '.' && part !== '')
66-
baseParts.push(part);
67-
}
68-
return baseParts.join('/');
69-
}
70-
7163
function isProtocolUrl(url) {
7264
return /^[a-zA-Z][\w+.-]*:\/\//.test(url);
7365
}
74-
75-
function isWindowsAbsolute(path) {
76-
return /^[a-zA-Z]:[\\/]/.test(path);
77-
}
78-
7966
function isUnixAbsolute(path) {
8067
return path.startsWith('/');
8168
}
69+
function isWindowsAbsolute(path) {
70+
return /^[a-zA-Z]:[\\/]/.test(path);
71+
}
8272

8373
/**
8474
* This function is called when the markdown html of a note is generated
@@ -135,5 +125,15 @@ QtObject {
135125
mdHtml = "<html>" + head + "<body>" + mdHtml + "</body></html>";
136126
return mdHtml;
137127
}
138-
128+
function resolvePath(base, relative) {
129+
const baseParts = base.replace(/\/+$/, '').split('/');
130+
const relParts = relative.replace(/^\.\/+/, '').split('/');
131+
for (const part of relParts) {
132+
if (part === '..')
133+
baseParts.pop();
134+
else if (part !== '.' && part !== '')
135+
baseParts.push(part);
136+
}
137+
return baseParts.join('/');
138+
}
139139
}

quick-commands/quick-commands.qml

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,19 +8,17 @@ import QOwnNotesTypes 1.0
88
*/
99

1010
Script {
11+
readonly property string _DDDDMY: "ddd (DD-MM-YYYY)"
1112
readonly property string _DDMM: "DD-MM"
1213
readonly property string _DDMMYYYY: "DD-MM-YYYY"
1314
readonly property string _FULL: "YYYY-MM-DDTHH:mm:ss"
1415
readonly property int _MILLI_DAY: 86400000
16+
readonly property variant _SHORT_DAYS_EN: ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"]
1517
readonly property string _WEEKWWYYYY: "wWW-YYYY"
1618
readonly property string _WWYYYY: "WW-YYYY"
1719
readonly property string _YYYYMMDD: "YYYY-MM-DD"
18-
readonly property string _DDDDMY: "ddd (DD-MM-YYYY)"
19-
readonly property variant _SHORT_DAYS_EN: ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"]
20-
2120
property var commands
2221
property string customCommands
23-
2422
property variant settingsVariables: [
2523
{
2624
"identifier": "customCommands",

0 commit comments

Comments
 (0)