[TikiWiki-commits] [Git][tikiwiki/tiki][master] [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 <69c5100318b97_3b18efc0472e7@gitlab-sidekiq-low-urgency-cpu-bound-v2-8464ddf68b-grzf2.mail>

Victor Emanouilov pushed to branch master at Tiki Wiki CMS Groupware / Tiki


Commits:
bb5fa70e by Victor Emanouilov at 2026-03-26T10:45:26+00: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/bb5fa70e492c91455cc0543735a649e81c10eb7e

-- 
View it on GitLab: https://gitlab.com/tikiwiki/tiki/-/commit/bb5fa70e492c91455cc0543735a649e81c10eb7e
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.