diff --git a/core/modules/storyviews/classic.js b/core/modules/storyviews/classic.js index c2848c435..044cd97f0 100644 --- a/core/modules/storyviews/classic.js +++ b/core/modules/storyviews/classic.js @@ -82,6 +82,10 @@ ClassicStoryView.prototype.remove = function(widget) { removeElement = function() { widget.removeChildDomNodes(); }; + // Blur the focus if it is within the descendents of the node we are removing + if($tw.utils.domContains(targetElement,targetElement.ownerDocument.activeElement)) { + targetElement.ownerDocument.activeElement.blur(); + } // Abandon if the list entry isn't a DOM element (it might be a text node) if(!targetElement || targetElement.nodeType === Node.TEXT_NODE) { removeElement(); diff --git a/editions/test/tiddlers/tests/test-tags-operator.js b/editions/test/tiddlers/tests/test-tags-operator.js index 002040613..87970d113 100644 --- a/editions/test/tiddlers/tests/test-tags-operator.js +++ b/editions/test/tiddlers/tests/test-tags-operator.js @@ -1,7 +1,7 @@ /*\ title: test-tags-operator.js type: application/javascript -tags: [[$:/tags/test-specX]] +tags: [[$:/tags/test-spec]] Tests the tagging mechanism. diff --git a/editions/tw5.com/tiddlers/empty-tag-node-template.tid b/editions/tw5.com/tiddlers/empty-tag-node-template.tid index a85a7f8d5..6827c6fe2 100644 --- a/editions/tw5.com/tiddlers/empty-tag-node-template.tid +++ b/editions/tw5.com/tiddlers/empty-tag-node-template.tid @@ -1,11 +1,11 @@ created: 20240710161501472 -list-after: $:/core/ui/ViewTemplate/body -modified: 20240713020832439 +list-after: +modified: 20240719201317702 tags: $:/tags/ViewTemplate title: $:/editions/tw5.com/empty-tag-node-template type: -<$list filter='[!has[text]] :filter[tagging[]]'> +<$list filter='[!has[text]!has[tags]] :filter[tagging[]]'> The following tiddlers are tagged with <>: -<!has[text]tagging[]]" class:"multi-columns">> \ No newline at end of file +<!has[text]!has[tags]tagging[]]" class:"multi-columns">> \ No newline at end of file diff --git a/plugins/tiddlywiki/markdown/editor-operations/make-markdown-link.js b/plugins/tiddlywiki/markdown/editor-operations/make-markdown-link.js index b124325c8..76f62f5a5 100644 --- a/plugins/tiddlywiki/markdown/editor-operations/make-markdown-link.js +++ b/plugins/tiddlywiki/markdown/editor-operations/make-markdown-link.js @@ -13,15 +13,15 @@ Text editor operation to make a markdown link "use strict"; exports["make-markdown-link"] = function(event,operation) { - var rx = /[()\\]/g, rs = '\\$&'; + var rx = /[()<>\\]/g, rs = '\\$&'; if(operation.selection) { var desc = operation.selection.replace(/[\[\]\\]/g, rs); if(event.paramObject.text.indexOf("://") !== -1) { - operation.replacement = "[" + desc + "](" + event.paramObject.text.replace(rx, rs) + ")"; + operation.replacement = "[" + desc + "](" + event.paramObject.text.replace(/[()\\]/g, rs) + ")"; } else { - operation.replacement = "[" + desc + "](#" + encodeURIComponent(event.paramObject.text).replace(rx, rs) + ")"; + operation.replacement = "[" + desc + "](<#" + event.paramObject.text.replace(rx, rs) + ">)"; } operation.cutStart = operation.selStart; operation.cutEnd = operation.selEnd; @@ -31,7 +31,7 @@ exports["make-markdown-link"] = function(event,operation) { return encodeURI(m); }) + ">"; } else { - operation.replacement = "[](#" + encodeURIComponent(event.paramObject.text).replace(rx, rs) + ")"; + operation.replacement = "[](<#" + event.paramObject.text.replace(rx, rs) + ">)"; } operation.cutStart = operation.selStart; operation.cutEnd = operation.selEnd;