You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@jspwiki.apache.org by ju...@apache.org on 2026/09/16 16:55:43 UTC
(jspwiki) branch master updated (79ce96395 -> cc9d3969a)
This is an automated email from the ASF dual-hosted git repository.
juanpablo-santos pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/jspwiki.git
from 79ce96395 3.0.1-git-02
new 70835b916 Refine link suggestion regex patterns
new 797c48da5 Refine regex for linkPart3 suggestions
new cc9d3969a Add link snippets for 'more' and 'class' in Snipe.js
The 3 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails. The revisions
listed as "add" were already present in the repository and have only
been added to this reference.
Summary of changes:
jspwiki-main/src/main/javascript/Wiki.Snips.JSPWiki.js | 9 ++++++---
jspwiki-markdown/src/main/javascript/Wiki.Snips.Markdown.js | 9 ++++++---
jspwiki-war/src/main/scripts/wiki-edit/Snipe.js | 10 ++++++++++
3 files changed, 22 insertions(+), 6 deletions(-)
(jspwiki) 02/03: Refine regex for linkPart3 suggestions
Posted by ju...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
juanpablo-santos pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/jspwiki.git
commit 797c48da5054cbc65779407588342694ad7af458
Author: Ulf Dittmer <34...@users.noreply.github.com>
AuthorDate: Mon Sep 14 10:37:19 2026 +0200
Refine regex for linkPart3 suggestions
Update regex patterns for link suggestions to improve matching behavior.
---
jspwiki-markdown/src/main/javascript/Wiki.Snips.Markdown.js | 9 ++++++---
1 file changed, 6 insertions(+), 3 deletions(-)
diff --git a/jspwiki-markdown/src/main/javascript/Wiki.Snips.Markdown.js b/jspwiki-markdown/src/main/javascript/Wiki.Snips.Markdown.js
index 94ccd7a0b..b43e0d902 100644
--- a/jspwiki-markdown/src/main/javascript/Wiki.Snips.Markdown.js
+++ b/jspwiki-markdown/src/main/javascript/Wiki.Snips.Markdown.js
@@ -397,9 +397,12 @@ Wiki.Snips = {
linkPart3:{
+ // Dialog must open after the second "|" even when "]" is not typed yet.
+ // Prefer matching up to "]" when present (attributes may contain spaces);
+ // otherwise only match non-whitespace so prose after the caret is not swallowed.
suggest: {
- lback: "\\[(?:[^\\|\\]]+\\|[^\\|\\]]+\\|)([^\\|\\[\\]\\n\\r]*)$",
- match: "^[^\\|\\]\\n\\r]*"
+ lback: "\\[(?:[^\\|\\]]+\\|[^\\|\\]]+\\|)([^\\|\\[\\]\\n\\r]*)$",
+ match: "^(?:[^\\|\\[\\]\\n\\r]*(?=\\])|[^\\|\\[\\]\\n\\r\\s]*)"
},
linkPart3: [ Dialog.Selection, {
@@ -656,4 +659,4 @@ Wiki.Snips = {
window.addEventListener("load", function() {
Wiki.Snips.loadPlugins();
-});
\ No newline at end of file
+});
(jspwiki) 01/03: Refine link suggestion regex patterns
Posted by ju...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
juanpablo-santos pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/jspwiki.git
commit 70835b916ecfac5522a64f058700a718a4b886b7
Author: Ulf Dittmer <34...@users.noreply.github.com>
AuthorDate: Mon Sep 14 10:35:43 2026 +0200
Refine link suggestion regex patterns
Updated regex patterns for link suggestions to improve matching behavior.
---
jspwiki-main/src/main/javascript/Wiki.Snips.JSPWiki.js | 9 ++++++---
1 file changed, 6 insertions(+), 3 deletions(-)
diff --git a/jspwiki-main/src/main/javascript/Wiki.Snips.JSPWiki.js b/jspwiki-main/src/main/javascript/Wiki.Snips.JSPWiki.js
index 23b9b4e38..58ffd6485 100644
--- a/jspwiki-main/src/main/javascript/Wiki.Snips.JSPWiki.js
+++ b/jspwiki-main/src/main/javascript/Wiki.Snips.JSPWiki.js
@@ -397,9 +397,12 @@ Wiki.Snips = {
linkPart3:{
+ // Dialog must open after the second "|" even when "]" is not typed yet.
+ // Prefer matching up to "]" when present (attributes may contain spaces);
+ // otherwise only match non-whitespace so prose after the caret is not swallowed.
suggest: {
- lback: "\\[(?:[^\\|\\]]+\\|[^\\|\\]]+\\|)([^\\|\\[\\]\\n\\r]*)$",
- match: "^[^\\|\\]\\n\\r]*"
+ lback: "\\[(?:[^\\|\\]]+\\|[^\\|\\]]+\\|)([^\\|\\[\\]\\n\\r]*)$",
+ match: "^(?:[^\\|\\[\\]\\n\\r]*(?=\\])|[^\\|\\[\\]\\n\\r\\s]*)"
},
linkPart3: [ Dialog.Selection, {
@@ -666,4 +669,4 @@ Wiki.Snips = {
};
window.addEventListener("load", function() {
Wiki.Snips.loadPlugins();
-});
\ No newline at end of file
+});
(jspwiki) 03/03: Add link snippets for 'more' and 'class' in Snipe.js
Posted by ju...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
juanpablo-santos pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/jspwiki.git
commit cc9d3969a47be7144aa57381910474380f6bb5c8
Author: Ulf Dittmer <34...@users.noreply.github.com>
AuthorDate: Mon Sep 14 10:38:59 2026 +0200
Add link snippets for 'more' and 'class' in Snipe.js
Added new link snippets for 'more' and 'class' in Snipe.js.
---
jspwiki-war/src/main/scripts/wiki-edit/Snipe.js | 10 ++++++++++
1 file changed, 10 insertions(+)
diff --git a/jspwiki-war/src/main/scripts/wiki-edit/Snipe.js b/jspwiki-war/src/main/scripts/wiki-edit/Snipe.js
index ee4edb132..f6369e9f0 100644
--- a/jspwiki-war/src/main/scripts/wiki-edit/Snipe.js
+++ b/jspwiki-war/src/main/scripts/wiki-edit/Snipe.js
@@ -763,12 +763,22 @@ var Snipe = new Class({
Selection will become "test", and snippet will become "wiki-page"
[te$st] => lback = "te", match = "test", snippet ="team-page"
Selection will become "st", and snippet will become "am-page"
+ [link|url|$ more] => lback = "", match = "", snippet = "target='_blank'"
+ Inserts at the caret; " more" is kept
+ [link|url|cla$ more] => lback = "cla", match = "cla", snippet = "class='viewer'"
+ Replaces only "cla"; " more" is kept
*/
suggestAction: function( txta, snippet, lback, match){
var start = txta.getSelectionRange().start,
len = match.length;
+ // If the forward match stopped early (e.g. at whitespace) but the user
+ // already typed more in the look-back, replace the whole look-back.
+ if( len < lback.length ){
+ len = lback.length;
+ }
+
//console.log("Snipe:suggestAction ",snippet,lback,match );
if( snippet.startsWith( lback ) ){