Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

replace custom code with html-entities package #189

Merged
merged 2 commits into from Feb 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
7 changes: 3 additions & 4 deletions assets/js/src/simple-page-ordering.js
@@ -1,5 +1,7 @@
import '../../css/scss/simple-page-ordering.scss';

import { decodeEntities } from '@wordpress/html-entities';

// eslint-disable-next-line import/no-unresolved
import 'jquery-ui-sortable';

Expand Down Expand Up @@ -48,10 +50,7 @@ function update_simple_ordering_callback(response) {
}
const dom_row_title = inline_key.parentNode.querySelector('.row-title');
if (dom_row_title !== null && post_title !== null) {
// Decode mdash character before rendering the title.
const textArea = document.createElement('textarea');
textArea.innerHTML = post_title;
dom_row_title.textContent = textArea.value;
dom_row_title.textContent = decodeEntities(post_title);
}
} else if (dom_menu_order !== null) {
dom_menu_order.textContent = new_pos[key];
Expand Down