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

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


Commits:
a4b106b2 by Victor Emanouilov at 2026-03-26T12:53:30+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
=====================================
@@ -99,9 +99,9 @@ class Tiki_Render_Editable
                 $editable = '<input type="hidden" id="allowhtml" name="allowhtml" value="1" /><textarea name="' . $fieldId . '" id="' . $fieldId . '" style="display:none" rows="' . $params['rows'] . '">' . htmlspecialchars($value) . '</textarea>';
                 TikiLib::lib('header')->add_jq_onready('CKEDITOR.replace( "' . $fieldId . '",' . $ckoptions . ');', 20);  // after dialog tools init (10)
             } 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 {
@@ -114,9 +114,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/a4b106b27db2b0406b54e8cdd487212e2c2d8e65

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