Skip to content

Commit

Permalink
v2.2.2
Browse files Browse the repository at this point in the history
  • Loading branch information
joshuafontany committed Apr 29, 2020
1 parent f981312 commit 7c64660
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 5 deletions.
File renamed without changes.
7 changes: 7 additions & 0 deletions history.tid
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
title: $:/plugins/joshuafontany/jsonmangler/history

* 2.2.2
** Improved the `slugify Operator`
** Resolved a bug where alerts were displayed when editing a json tiddler.

* 2.2.1
** TW 5.1.22 Release bugfixes (LF/CRLF) for patch file.

* 2.2.0
** TW 5.1.22 Release Sync-up.
** Moved the Plugin Management Control Panel tab to its own plugin (seperate github repo).
Expand Down
2 changes: 1 addition & 1 deletion modules/utils/jsonutils.js
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ exports.jsonIsValid = function(titleOrTiddler, data) {
if(!(data)){
data = tiddler.fields.text;
}
if(tiddler && data) {
if(tiddler && data && !tiddler.fields["draft.of"]) {
try {
if(/^\s*[{[]/.test(data.toString())){
JSON.parse(data);
Expand Down
5 changes: 2 additions & 3 deletions modules/utils/slugify.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,13 @@ exports.slugifyText = function(wiki,title) {
slug = tiddler.fields.slug;
} else {
slug =
// $tw.utils.transliterate(title.toString().toLowerCase()) // Replace diacritics with basic lowercase ASCII
title.toString().toLowerCase()
$tw.utils.transliterate(title.toString().toLowerCase()) // Replace diacritics with basic lowercase ASCII
.replace(/\s+/g,"-") // Replace spaces with -
.replace(/[^\w\-\.]+/g,"") // Remove all non-word chars except dash and dot
.replace(/\-\-+/g,"-") // Replace multiple - with single -
.replace(/^-+/,"") // Trim - from start of text
.replace(/-+$/,"") // Trim - from end of text
.replace(/^[^a-z0-9]+$/g, "_"); // Remove diacritics
.replace(/^[^a-z0-9]+$/g, "_"); // Remove diacritics
}
// If the resulting slug is blank (eg because the title is just punctuation characters)
if(!slug) {
Expand Down
2 changes: 1 addition & 1 deletion plugin.info
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"description": "Complex JSON and CSV Support",
"dependents": "$:/plugins/ebalster/modloader",
"author": "Joshua Fontany",
"version": "2.2.1",
"version": "2.2.2",
"core-version": ">=5.1.22",
"source": "https://github.com/joshuafontany/TW5-JsonMangler",
"plugin-type": "plugin",
Expand Down

0 comments on commit 7c64660

Please sign in to comment.