Fix editor tags HTML entities

This commit is contained in:
Dan 2025-04-23 05:41:07 +07:00
commit f6a8caa379
2 changed files with 18 additions and 2 deletions

View file

@ -42,11 +42,19 @@ if (file_exists($field_file)) {
<link rel="stylesheet" href="<?php echo site_url() ?>system/resources/css/jquery-ui.css">
<script>
$( function() {
// Decode HTML entities
function decodeHtml(html) {
var txt = document.createElement("textarea");
txt.innerHTML = html;
return txt.value;
}
var availableTags = [
<?php foreach ($tags as $tag => $count):?>
"<?php echo tag_i18n($tag) ?>",
<?php endforeach;?>
];
].map(decodeHtml); // Decoding all tags
function split( val ) {
return val.split( /,\s*/ );
}

View file

@ -88,11 +88,19 @@ if (file_exists($field_file)) {
<link rel="stylesheet" href="<?php echo site_url() ?>system/resources/css/jquery-ui.css">
<script>
$( function() {
// Decode HTML entities
function decodeHtml(html) {
var txt = document.createElement("textarea");
txt.innerHTML = html;
return txt.value;
}
var availableTags = [
<?php foreach ($tags as $tag => $count):?>
"<?php echo tag_i18n($tag) ?>",
<?php endforeach;?>
];
].map(decodeHtml); // Decoding all tags
function split( val ) {
return val.split( /,\s*/ );
}