Skip to content

Commit

Permalink
New build with htmlfy 0.3.2
Browse files Browse the repository at this point in the history
  • Loading branch information
jmuletpol committed Oct 12, 2024
1 parent 479da03 commit 220d210
Show file tree
Hide file tree
Showing 6 changed files with 28 additions and 22 deletions.
2 changes: 1 addition & 1 deletion amd/build/cm6pro-lazy.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion amd/build/cm6pro-lazy.min.js.map

Large diffs are not rendered by default.

13 changes: 7 additions & 6 deletions amd/src/cm6pro-lazy.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/** @ts-ignore */
/* eslint-disable */
/**
The data structure for documents. @nonabstract
Expand Down Expand Up @@ -28227,7 +28228,7 @@ const CONFIG = {
* @param {string} content Content to evaluate.
* @returns {boolean} A boolean.
*/
const hasHtml = (content) => {
const isHtml = (content) => {
const regex = /<(?<Element>[A-Za-z]+\b)[^>]*(?:.|\n)*?<\/{1}\k<Element>>/;
return regex.test(content)
};
Expand Down Expand Up @@ -28325,7 +28326,7 @@ const void_elements = [
*/
const closify = (html, html_check = true) => {
if (html_check)
if (!hasHtml(html)) return html
if (!isHtml(html)) return html

return html.replace(/<([a-zA-Z\-0-9]+)[^>]*>/g, (match, name) => {
if (void_elements.indexOf(name) > -1) {
Expand Down Expand Up @@ -28414,7 +28415,7 @@ const entify = (html, minify = false) => {
*/
const minify = (html, html_check = true) => {
if (html_check)
if (!hasHtml(html)) return html
if (!isHtml(html)) return html

/**
* Ensure textarea content is specially minified and protected
Expand Down Expand Up @@ -28574,12 +28575,12 @@ const process$1 = (html, step) => {
* @returns {string} A well-formed HTML string.
*/
const prettify = (html, config) => {
/* Return content as-is if it does not contain any HTML elements. */
if (!isHtml(html)) return html

const validated_config = config ? validateConfig(config) : CONFIG;
strict = validated_config.strict;

/* Return content as-is if it does not contain any HTML elements. */
if (!hasHtml(html)) return html

html = preprocess(html);
html = process$1(html, validated_config.tab_size);

Expand Down
26 changes: 13 additions & 13 deletions libs/codemirror/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion libs/codemirror/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
"dependencies": {
"@codemirror/lang-html": "^6.4.9",
"codemirror": "^6.0.1",
"htmlfy": "^0.2.1"
"htmlfy": "^0.3.2"
},
"devDependencies": {
"@rollup/plugin-node-resolve": "^15.1.0",
Expand Down
5 changes: 5 additions & 0 deletions upgrade.txt
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,8 @@ Updated helplinktext
== 1.1.2 ==
Fix Issue #10: Wrong area target to insert htmlcode
Get focus on editor when opened

== 1.1.3 ==
Fix Issue #12: Missing Language string
Override style imposed by body.tox-fullscreen on modal-header
Updated htmlfy dependency to 0.3.2

0 comments on commit 220d210

Please sign in to comment.