Skip to content

Commit

Permalink
fix: prevent duplicated linebreaks in loaded tiddlers on Windows
Browse files Browse the repository at this point in the history
  • Loading branch information
YakovL committed Jun 16, 2024
1 parent 2f630dd commit 615167a
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion TiddlerInFilePlugin.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
|Description |Allows to store any number of tiddlers as external files and more|
|Source |https://github.com/YakovL/TiddlyWiki_TiddlerInFilePlugin/blob/master/TiddlerInFilePlugin.js|
|Author |Yakov Litvin|
|Version |1.1.3|
|Version |1.1.4|
|License |[[MIT|https://github.com/YakovL/TiddlyWiki_YL_ExtensionsCollection/blob/master/Common%20License%20(MIT)]]|
!!!Usage
Once the plugin is installed (copy - tag {{{systemConfig}}} - reload) storing tiddlers in files is done via 2 steps:
Expand Down Expand Up @@ -87,6 +87,8 @@ config.macros.external = {
const tiddler = store.fetchTiddler(meta.tiddlerName) ||
new Tiddler(meta.tiddlerName)
format.internalize(tiddler, source) //# pass meta to tiddler?
// a patch for Windows: don't get linebreaks duplicated
tiddler.text = tiddler.text.replace(/\r\n/g, '\n')
tiddler.doNotSave = function() { return !meta.keepInTW }
meta.tiddler = tiddler

Expand Down

0 comments on commit 615167a

Please sign in to comment.