mirror of
https://github.com/Jermolene/TiddlyWiki5
synced 2025-04-11 05:06:38 +00:00
Merge branch 'master' into feat-ai-tools
This commit is contained in:
commit
dbb7e1c300
@ -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();
|
||||
|
@ -1,7 +1,7 @@
|
||||
/*\
|
||||
title: test-tags-operator.js
|
||||
type: application/javascript
|
||||
tags: [[$:/tags/test-specX]]
|
||||
tags: [[$:/tags/test-spec]]
|
||||
|
||||
Tests the tagging mechanism.
|
||||
|
||||
|
@ -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='[<storyTiddler>!has[text]] :filter[tagging[]]'>
|
||||
<$list filter='[<storyTiddler>!has[text]!has[tags]] :filter[tagging[]]'>
|
||||
The following tiddlers are tagged with <<tag>>:
|
||||
</$list>
|
||||
<<list-links filter:"[<storyTiddler>!has[text]tagging[]]" class:"multi-columns">>
|
||||
<<list-links filter:"[<storyTiddler>!has[text]!has[tags]tagging[]]" class:"multi-columns">>
|
@ -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;
|
||||
|
Loading…
x
Reference in New Issue
Block a user