Comments (7)
Best mention the authors of the script (see issue template).
from scripts.
I updated the script with a better regex. Please check if this works for you.
from scripts.
That seems to work for me. Thanks a lot!
@Maboroshy I guess, the epsilon-notes-tags script has exactly the same problem. At least when I tested it, it was unusable on windows unless QOwnNotes was explicitly configured to use UNIX style line breaks.
from scripts.
Now that a regex! I'll have a look and update epsilon-notes-tags script accordingly.
from scripts.
You should be able to replace this entire part:
if (noteText.substring(0, 4) == '---\n') {
var yamlEndIndex = noteText.indexOf('\n...\n')
// If there's no proper "..." YAML ending "---" is recognized as one
if (yamlEndIndex == -1)
yamlEndIndex = noteText.indexOf('\n---\n')
if (yamlEndIndex != -1) {
noteYaml = noteText.substring(0, yamlEndIndex)
const tagLineMatch = noteYaml.match(/^tags:(.*)/m)
if (tagLineMatch != null) {
const tagLineStartIndex = tagLineMatch.index
const tagLineEndIndex = tagLineStartIndex + tagLineMatch[0].length
tagLine = tagLineMatch[0]
yamlTags = tagLineMatch[1].trim().split(' ')
}
}
}
with
let regex_yaml_header =/^(---)[\r\n]*?(tags:)\s*(.*)[\r\n]*?(---|\.\.\.)/ // g0: full match, g1: ---, g2: "tags:", g3: tags, g4: yaml ending
var match = noteText.match(regex_yaml_header)
if (match) {
yamlTags = match[3].trim().split(' ')
}
from scripts.
@mmehnert please close the issue if it works for you now.
from scripts.
Works for me. Thanks!
from scripts.
Related Issues (20)
- [FEATURE] WYSIWYG
- [BUG] Highlighted text in dark mode is not legible. HOT 7
- [FEATURE] Color selector menu for text highlighter HOT 4
- [SUPPORT] Script to automatically format the Markdown each save HOT 3
- [SUPPORT] Stuck trying to get Backlinks script to work HOT 4
- [SUPPORT] Mermaid diagrams script: theme configuration for sequenceDiagram HOT 6
- [BUG] Latex Math v0.0.6 script doesn't update pictures when color style is changed HOT 7
- [BUG] Toggle checkbox - checkbox where added in wrong place when autocreated from list HOT 5
- [FEATURE] Add video display support HOT 3
- [BUG] The "YAML nested tags" script breaks formatting and causing text lost in preview HOT 4
- [BUG] "exportFolder is not defined" in export-notes-as-website HOT 7
- [BUG] A Wiki Link to a note under notes sub-folder gives pop up "Note was not found" even if it exists HOT 4
- [SUPPORT] HOT 11
- [SUPPORT] HOT 2
- [SUPPORT] LateX Math results in very aliased images HOT 8
- adding favorite note script results with error " Expected a qualified name id"[BUG] HOT 10
- [SUPPORT] HOT 7
- [BUG] can't follow [[wiki linked]] file links that have spaces HOT 2
- [BUG] Scripts "export note as website" not working properly on Windows HOT 7
- [BUG] export note using pandoc not working on windows HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from scripts.