From 5ko at 5ko.fr Sat Jan 10 12:38:47 2026 From: 5ko at 5ko.fr (Petko Yotov) Date: Sat, 10 Jan 2026 21:38:47 +0100 Subject: [pmwiki-users] PmWiki 2.5.5 released Message-ID: Hello. PmWiki version 2.5.5 was published today, and is available at: https://www.pmwiki.org/pub/pmwiki/pmwiki-2.5.5.tgz https://www.pmwiki.org/pub/pmwiki/pmwiki-2.5.5.zip svn://www.pmwiki.org/pmwiki/tags/latest This release includes updates for recent PHP versions. New markup !!#id Heading allows to define id attributes of headings or page sections. These can be referenced in links to the heading, and it is possible to include page sections based on these identifiers, similar to [[#anchor]]. Before or after upgrading to 2.5.5, you may want to search your wiki for "!#" in case there are matches on your pages, and if needed, insert a space before the "#" characters. Improvements to Forms features. The edit form with $EnableMergeLastMinorEdit, checking the "Minor edit" checkbox will pre-fill the change summary field with the previous summary. It is now possible to define custom attributes to the options of a "select" field. The Not-Saved-Warning feature is now available to custom forms with the attribute (:input form data-confirmunload=1:); if such form has changes, and the user tries to leave the page without saving the changes, the browser will ask for confirmation. Improvements to the core JavaScript utilities and the PmLib library. Optimizations for PmSyntax for long or complex texts. Sortable tables will show the arrows to the left if the header cell is right-aligned. It is now possible to Shift+click to check or uncheck multiple checkboxes. Table of contents will show a tooltip to the back-to-contents link, and will no longer number a single heading. Core styles defined in $HTMLStylesFmt are already in pub/lib/pmwiki-core.css, now the duplicates have been removed from the scripts. This makes it easier to redefine them by skins and local styles, and is a step toward a stricter Content-Security-Policy. The dark theme now has slightly darker backgrounds to the "simpletable" tables. A new markup (:dropzone uploadpage=Group.Name:) allows to include an area where editors can drop files for upload, without opening the page for editing or uploading. Multiple zones in a page could upload files to different pages or groups. Url approvals have a new confirmation page to preview all pending sites and links in the current page, extracted for easier review, checkboxes to selectively approve them, and the full page shown below with the pending links highlighted. A bug was fixed with Notify and the tz= attribute which could affect later recipients, and another with RecipeCheck when the hosting has disabled remote retrieval. The documentation was updated. Thanks, Petko -- If you upgrade : https://www.pmwiki.org/Upgrades From martin.cuno at posteo.de Mon Jan 19 02:00:25 2026 From: martin.cuno at posteo.de (Martin Cuno) Date: Mon, 19 Jan 2026 10:00:25 +0000 Subject: [pmwiki-users] TOC no scrolling please Message-ID: <4dvmD944Xzz9rxQ@submission02.posteo.de> Hello friends, I'm experimenting with Table of Contents (TOC), https://www.pmwiki.org/wiki/PmWiki/TableOfContents: My problem: I need to print PDFs of pages containing a TOC. If the TOC is too long, it gets cut off at the bottom. How can I prevent this? In the browser view, a scrollbar appears if the TOC is too long. Following the instructions on the linked page, I'm experimenting with: PmTOCdiv {font-size: 90%; max-height: 2000px; overflow: hidden; @LH12} etc. in local.css, but without success. (@LH12 = line height; this is my workaround, but it's not satisfactory) What can I do? Why doesn't "overflow: hidden" work? And: could a simple option be added to prevent scrolling when needed? Thanks! Martin -- Diese E-Mail wurde von Avast-Antivirussoftware auf Viren gepr?ft. www.avast.com From 5ko at 5ko.fr Mon Jan 19 02:30:02 2026 From: 5ko at 5ko.fr (Petko Yotov) Date: Mon, 19 Jan 2026 11:30:02 +0100 Subject: [pmwiki-users] TOC no scrolling please In-Reply-To: <4dvmD944Xzz9rxQ@submission02.posteo.de> References: <4dvmD944Xzz9rxQ@submission02.posteo.de> Message-ID: <2728d36aff69298fc05839186a64c5ac@5ko.fr> The solution will depend on this information: Do you print the page directly, by pressing File-Print or Ctrl+P in your browser, or do you first go to Page?action=print? Do you want to print the full table of contents, or to hide it? If the user has closed the table of contents, what should be printed, nothing, or the closed box, or the box should open and expand? Petko -- If you upgrade : https://www.pmwiki.org/Upgrades On 19/01/2026 11:00, Martin Cuno wrote: > Hello friends, > > I'm experimenting with Table of Contents (TOC), > https://www.pmwiki.org/wiki/PmWiki/TableOfContents: > > My problem: I need to print PDFs of pages containing a TOC. If the TOC > is too long, it gets cut off at the bottom. How can I prevent this? In > the browser view, a scrollbar appears if the TOC is too long. > Following the instructions on the linked page, I'm experimenting with: > > PmTOCdiv {font-size: 90%; max-height: 2000px; overflow: hidden; @LH12} > > etc. in local.css, but without success. > > (@LH12 = line height; this is my workaround, but it's not satisfactory) > > What can I do? Why doesn't "overflow: hidden" work? > > And: could a simple option be added to prevent scrolling when needed? > > Thanks! Martin From martin.cuno at posteo.de Mon Jan 19 02:55:49 2026 From: martin.cuno at posteo.de (Martin Cuno) Date: Mon, 19 Jan 2026 10:55:49 +0000 Subject: [pmwiki-users] TOC no scrolling please Message-ID: <4dvnS60Cpnz6twS@submission01.posteo.de> I want to print the complete table of contents (with working links, forward and backward; this works well in Firefox). These are primarily documents that I want to provide to users as PDFs. How users print the pages isn't important at the moment. I'm not using `action=print`, or rather, I've defined `$ActionSkin['print'] = (the default skin)'. Martin ===== Urspr?ngliche Nachricht ===== Von: Petko Yotov <5ko at 5ko.fr> Am: 19.01.2026, 11:30:02 Uhr Betreff: Re: [pmwiki-users] TOC no scrolling please The solution will depend on this information: Do you print the page directly, by pressing File-Print or Ctrl+P in your browser, or do you first go to Page?action=print? Do you want to print the full table of contents, or to hide it? If the user has closed the table of contents, what should be printed, nothing, or the closed box, or the box should open and expand? Petko -- Diese E-Mail wurde von Avast-Antivirussoftware auf Viren gepr?ft. www.avast.com From 5ko at 5ko.fr Mon Jan 19 03:21:56 2026 From: 5ko at 5ko.fr (Petko Yotov) Date: Mon, 19 Jan 2026 12:21:56 +0100 Subject: [pmwiki-users] TOC no scrolling please In-Reply-To: <4dvnS60F2kz6twY@submission01.posteo.de> References: <4dvnS60F2kz6twY@submission01.posteo.de> Message-ID: I have updated the core styles for the next PmWiki version. If the table of contents is closed, the [Contents] frame will not be printed. If it is open, the full table of contents will be printed without scrolling or hidden lines. Try it on a page on pmwiki.org with many headings, for example here: https://www.pmwiki.org/wiki/PmWiki/ChangeLog You can add this to pub/css/local.css to enable the same before upgrading to 2.5.6: @media print { .PmTOCtable { max-height: none; overflow: visible; line-height: var(--pm-lineheight); } .PmTOCdiv:not([open]) { display:none; } } Petko -- If you upgrade : https://www.pmwiki.org/Upgrades On 19/01/2026 11:55, Martin Cuno wrote: > I want to print the complete table of contents (with working links, > forward and backward; this works well in Firefox). These are primarily > documents that I want to provide to users as PDFs. How users print the > pages isn't important at the moment. > > I'm not using `action=print`, or rather, I've defined > `$ActionSkin['print'] = (the default skin)'. > > Martin > > ===== Urspr?ngliche Nachricht ===== > Von: Petko Yotov <5ko at 5ko.fr> > Am: 19.01.2026, 11:30:02 Uhr > Betreff: Re: [pmwiki-users] TOC no scrolling please > > The solution will depend on this information: > > Do you print the page directly, by pressing File-Print or Ctrl+P in > your > browser, or do you first go to Page?action=print? > > Do you want to print the full table of contents, or to hide it? > > If the user has closed the table of contents, what should be printed, > nothing, or the closed box, or the box should open and expand? > > Petko > > > > -- > Diese E-Mail wurde von Avast-Antivirussoftware auf Viren gepr?ft. > www.avast.com From martin.cuno at posteo.de Mon Jan 19 03:46:07 2026 From: martin.cuno at posteo.de (Martin Cuno) Date: Mon, 19 Jan 2026 11:46:07 +0000 Subject: [pmwiki-users] TOC no scrolling please Message-ID: <4dvpZ75MZNz6tvs@submission01.posteo.de> Thanks, Petko! Perfect as always, and so fast! Just so you know, though: it's not working on the Changelog page. It makes no difference whether I open or close the table of contents. Both times it shows up to version 2.3.35. It's also noticeable that the table of contents starts on a new page. (Windows, Firefox, "save as PDF") But thanks anyway, it works perfectly for me! Martin ===== Urspr?ngliche Nachricht ===== Von: Petko Yotov <5ko at 5ko.fr> Am: 19.01.2026, 12:21:56 Uhr Betreff: Re: [pmwiki-users] TOC no scrolling please I have updated the core styles for the next PmWiki version. If the table of contents is closed, the [Contents] frame will not be printed. If it is open, the full table of contents will be printed without scrolling or hidden lines. Try it on a page on pmwiki.org with many headings, for example here: https://www.pmwiki.org/wiki/PmWiki/ChangeLog You can add this to pub/css/local.css to enable the same before upgrading to 2.5.6: @media print { .PmTOCtable { max-height: none; overflow: visible; line-height: var(--pm-lineheight); } .PmTOCdiv:not([open]) { display:none; } } Petko -- Diese E-Mail wurde von Avast-Antivirussoftware auf Viren gepr?ft. www.avast.com From 5ko at 5ko.fr Mon Jan 19 05:03:19 2026 From: 5ko at 5ko.fr (Petko Yotov) Date: Mon, 19 Jan 2026 14:03:19 +0100 Subject: [pmwiki-users] TOC no scrolling please In-Reply-To: <4dvpZ75LZWz6tvk@submission01.posteo.de> References: <4dvpZ75LZWz6tvk@submission01.posteo.de> Message-ID: <18a6f3d5f2e3bb5285b578d6ed85c159@5ko.fr> On 19/01/2026 12:46, Martin Cuno wrote: > Just so you know, though: it's not working on the Changelog page. It > makes no difference whether I open or close the table of contents. When styles and scripts are modified, you may need to clear the cache in your browser so that it pulls the new scripts and styles. Normally you press and hold down the Shift key, then click on the Reload page button (circular arrow) near the top left side of the browser window, then release the Shift key. Or try again a little later. Petko From design at softflow.uk Fri Jan 23 08:07:59 2026 From: design at softflow.uk (Hans Bracker) Date: Fri, 23 Jan 2026 16:07:59 +0000 Subject: [pmwiki-users] text replace using regex in edit textarea Message-ID: <810adf32-3d96-43b3-b832-b12d5bd054e6@softflow.uk> Hi Petko, I am wondering if there is a way to add a custom guibutton and/or keyboard shortcut to do a custom text replace on a text selection in the standard edit textarea? I would like to select some text in the edit textarea, like a paragraph, or more, from a longer page text, and then via? a button click or a keyboard shortcut have a regular expression replace done on this text. In particular I like to strip out newline \n and replace with simple space, to undo formatting from inserted pdf text. I can do this in my code editor, but copying and pasting paragraphs back and forward is a hassle. Ideally I like to choose the regular expression, or set up different custom "regex text replace" buttons. I don't know if i need to hack the guiedit javascript, or how to add the functionality in javascript. Some advice would be greatly appreciated! cheers, Hans From 5ko at 5ko.fr Fri Jan 23 09:36:59 2026 From: 5ko at 5ko.fr (Petko Yotov) Date: Fri, 23 Jan 2026 18:36:59 +0100 Subject: [pmwiki-users] text replace using regex in edit textarea In-Reply-To: <810adf32-3d96-43b3-b832-b12d5bd054e6@softflow.uk> References: <810adf32-3d96-43b3-b832-b12d5bd054e6@softflow.uk> Message-ID: <4dc9d064c1ebeb25335a066e6034bf24@5ko.fr> I would reuse the core JavaScript GUIEdit functions and the PmLib helpers available since PmWiki 2.4.0 (latest recommended). Create a file, say pub/myrxreplace.js, and put in it something like this: PmLib.ready(function(){ const { dqs, dce, adjbe, tap } = PmLib; // import helpers const container = dqs('span.GUIButtons'); if(!container) return; const button = dce('input', {type:'button', value:'RXR'}); adjbe(container, button); // add before the end of GUIButtons function replace_in_selection(selection) { if(selection==='') return ''; let result = selection .replace(/\r\n?/g, "\n") // normalize line breaks .replace(/ *(\n *)+/g, ' ') // join lines .replace(/pmwiki/ig, 'PmWiki') // fix capitalization // add your own ; return result; } tap(button, function(){ // onclick insMarkup(replace_in_selection); }); }); Enable this script in local/config.php, assumes $EnableGUIButtons is enabled: if($action=='edit') $HTMLHeaderFmt['myrxreplace'] = ''; The "const button..." part is the button added to the end of the GUI buttons container. The value 'RXR' is the button label, obviously you can change it, or even use an emoji. Select some text in the edit textarea and click on the button. This will cause the function replace_in_selection() to be called with argument the current selection text. It should make the replacements and changes, then return the result which will be inserted in place of the selection in the edit textarea. I would also enable $EnablePreviewChanges = 1; and press "Preview" to see my changes before saving the page. Using the built-in helper functions is much simpler and easier than doing it in plain JavaScript, you don't need to locate the textarea, detect the selection, handle undo/redo, sync with PmSyntax, everything works under the hood. Petko -- If you upgrade : https://www.pmwiki.org/Upgrades On 23/01/2026 17:07, Hans Bracker wrote: > Hi Petko, I am wondering if there is a way to add a custom guibutton > and/or keyboard shortcut to do a custom text replace on a text > selection in the standard edit textarea? > > I would like to select some text in the edit textarea, like a > paragraph, or more, from a longer page text, and then via? a button > click or a keyboard shortcut have a regular expression replace done on > this text. In particular I like to strip out newline \n and replace > with simple space, to undo formatting from inserted pdf text. I can do > this in my code editor, but copying and pasting paragraphs back and > forward is a hassle. Ideally I like to choose the regular expression, > or set up different custom "regex text replace" buttons. > > I don't know if i need to hack the guiedit javascript, or how to add > the functionality in javascript. Some advice would be greatly > appreciated! From design at softflow.uk Fri Jan 23 10:23:40 2026 From: design at softflow.uk (Hans Bracker) Date: Fri, 23 Jan 2026 18:23:40 +0000 Subject: [pmwiki-users] text replace using regex in edit textarea In-Reply-To: <4dc9d064c1ebeb25335a066e6034bf24@5ko.fr> References: <810adf32-3d96-43b3-b832-b12d5bd054e6@softflow.uk> <4dc9d064c1ebeb25335a066e6034bf24@5ko.fr> Message-ID: <97c6c428-f8bb-4608-bd27-6037f5ed8767@softflow.uk> thank you Petko, you are genius! It works just fine! I am using a different regex though, from what you proposed, in order to preserve empty lines between paragraphs, when selecting multiple paragraphs: .replace(/([^\s])\n([^\s])/g, "$1 $2") Hans On 23/01/2026 17:36, Petko Yotov wrote: > I would reuse the core JavaScript GUIEdit functions and the PmLib > helpers available since PmWiki 2.4.0 (latest recommended). > > Create a file, say pub/myrxreplace.js, and put in it something like this: > > ? PmLib.ready(function(){ > ??? const { dqs, dce, adjbe, tap } = PmLib; // import helpers > > ??? const container = dqs('span.GUIButtons'); > ??? if(!container) return; > ??? const button = dce('input', {type:'button', value:'RXR'}); > ??? adjbe(container, button); // add before the end of GUIButtons > > ??? function replace_in_selection(selection) { > ????? if(selection==='') return ''; > ????? let result = selection > ??????? .replace(/\r\n?/g, "\n") // normalize line breaks > ??????? .replace(/ *(\n *)+/g, ' ')??? // join lines > ??????? .replace(/pmwiki/ig, 'PmWiki') // fix capitalization > ??????? // add your own > ????? ; > ????? return result; > ??? } > > ??? tap(button, function(){ // onclick > ????? insMarkup(replace_in_selection); > ??? }); > ? }); > > Enable this script in local/config.php, assumes $EnableGUIButtons is > enabled: > > ? if($action=='edit') $HTMLHeaderFmt['myrxreplace'] > ???? = ''; > > The "const button..." part is the button added to the end of the GUI > buttons container. The value 'RXR' is the button label, obviously you > can change it, or even use an emoji. > > Select some text in the edit textarea and click on the button. This > will cause the function replace_in_selection() to be called with > argument the current selection text. It should make the replacements > and changes, then return the result which will be inserted in place of > the selection in the edit textarea. > > I would also enable $EnablePreviewChanges = 1; and press "Preview" to > see my changes before saving the page. > > Using the built-in helper functions is much simpler and easier than > doing it in plain JavaScript, you don't need to locate the textarea, > detect the selection, handle undo/redo, sync with PmSyntax, everything > works under the hood. > > Petko > -------------- next part -------------- An HTML attachment was scrubbed... URL: