[TikiWiki-commits] [Git][tikiwiki/tiki][30.x] [FIX] inline editable lazy render - bypass npn-parsable blocks

"Victor Emanouilov \(@kroky\) via TikiWiki-cvs" <[email protected]>
Newsgroups gmane.comp.cms.tiki.cvs
Message-ID <69c5101835aed_3b18efe8703fb@gitlab-sidekiq-low-urgency-cpu-bound-v2-8464ddf68b-znrs8.mail>

Victor Emanouilov pushed to branch 30.x at Tiki Wiki CMS Groupware / Tiki


Commits:
1962afc1 by Victor Emanouilov at 2026-03-26T12:53:06+02:00
[FIX] inline editable lazy render - bypass npn-parsable blocks
---
* [FIX] inline editable lazy render - bypass npn-parsable blocks as formatter handles the context switch (between html/wiki) and adds necessary ~np~ tags only when needed; otherwise, we end up with nested ~np~ tags which parserlib does not (yet) support properly

See merge request tikiwiki/tiki!9860

- - - - -


1 changed file:

- lib/core/Tiki/Render/Editable.php


Changes:

=====================================
lib/core/Tiki/Render/Editable.php
=====================================
@@ -98,9 +98,9 @@ class Tiki_Render_Editable
                 TikiLib::lib('wysiwyg')->setUpEditor($fieldId, $params);
                 $editable = '<input type="hidden" id="allowhtml" name="allowhtml" value="1" /><textarea name="' . $fieldId . '" id="' . $fieldId . '" style="display:none" rows="' . $params['rows'] . '">' . htmlspecialchars($value) . '</textarea>';
             } elseif ($this->layout == 'block') {
-                $editable = $this->wrapNp('<textarea class="form-control" name="' . $fieldId . '" id="' . $fieldId . '" rows="' . $params['rows'] . '">' . htmlspecialchars($value) . '</textarea>');
+                $editable = '<textarea class="form-control" name="' . $fieldId . '" id="' . $fieldId . '" rows="' . $params['rows'] . '">' . htmlspecialchars($value) . '</textarea>';
             } else {
-                $editable = $this->wrapNp('<input type="text" class="form-control" name="' . $fieldId . '" id="' . $fieldId . '" value="' . htmlspecialchars($value) . '" />');
+                $editable = '<input type="text" class="form-control" name="' . $fieldId . '" id="' . $fieldId . '" value="' . htmlspecialchars($value) . '" />';
             }
             $editable = '<div style="display: none">' . $editable . '</div>';
         } else {
@@ -113,9 +113,4 @@ class Tiki_Render_Editable
 
         return "<$tag class=\"$class\" data-field-fetch-url=\"$fieldFetch\" data-object-store-url=\"$objectStore\" data-group=\"$group\" data-label=\"$label\" data-field-id=\"$fieldId\" data-field-type=\"$fieldType\">$value" . smarty_function_icon(['name' => 'edit', 'iclass' => 'ml-2'], $smarty->getEmptyInternalTemplate()) . "</$tag>$editable";
     }
-
-    private function wrapNp($content)
-    {
-        return '~np~' . str_replace(['~np~', '~/np~'], '', $content) . '~/np~';
-    }
 }



View it on GitLab: https://gitlab.com/tikiwiki/tiki/-/commit/1962afc138d002981c0c31491d503ffc57fb67d9

-- 
View it on GitLab: https://gitlab.com/tikiwiki/tiki/-/commit/1962afc138d002981c0c31491d503ffc57fb67d9
You're receiving this email because of your account on gitlab.com. Manage all notifications: https://gitlab.com/-/profile/notifications | Help: https://gitlab.com/help

_______________________________________________
TikiWiki-cvs mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/tikiwiki-cvs
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.