Skip to content

Commit

Permalink
apply cm5 lively4 patches
Browse files Browse the repository at this point in the history
SQUASHED: AUTO-COMMIT-src-external-code-mirror-lib-codemirror.js,AUTO-COMMIT-src-external-code-mirror-mode-htmlmixed-htmlmixed.js,AUTO-COMMIT-src-external-code-mirror-mode-markdown-markdown.js,
  • Loading branch information
JensLincke committed Jun 13, 2024
1 parent b376f94 commit 6a7c019
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 10 deletions.
3 changes: 3 additions & 0 deletions src/external/code-mirror/lib/codemirror.js
Original file line number Diff line number Diff line change
Expand Up @@ -9877,6 +9877,9 @@

addLegacyProps(CodeMirror);

// Lively Hacks
CodeMirror.posToDOM = posToDOM

CodeMirror.version = "5.65.16";

return CodeMirror;
Expand Down
6 changes: 3 additions & 3 deletions src/external/code-mirror/mode/htmlmixed/htmlmixed.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

(function(mod) {
if (typeof exports == "object" && typeof module == "object") // CommonJS
mod(require("../../lib/codemirror"), require("../xml/xml"), require("../javascript/javascript"), require("../css/css"));
mod(require("../../lib/codemirror"), require("../xml/xml"), require("../javascript/javascript"), require("../jsx/jsx"), require("../css/css"));
else if (typeof define == "function" && define.amd) // AMD
define(["../../lib/codemirror", "../xml/xml", "../javascript/javascript", "../css/css"], mod);
else // Plain browser env
Expand All @@ -13,8 +13,8 @@

var defaultTags = {
script: [
["lang", /(javascript|babel)/i, "javascript"],
["type", /^(?:text|application)\/(?:x-)?(?:java|ecma)script$|^module$|^$/i, "javascript"],
["lang", /(javascript|babel)/i, "jsx"],
["type", /^(?:text|application)\/(?:x-)?(?:java|ecma)script$|^module$|^$/i, "jsx"],
["type", /./, "text/plain"],
[null, null, "javascript"]
],
Expand Down
15 changes: 8 additions & 7 deletions src/external/code-mirror/mode/markdown/markdown.js
Original file line number Diff line number Diff line change
Expand Up @@ -285,13 +285,14 @@ CodeMirror.defineMode("markdown", function(cmCfg, modeCfg) {
var style = htmlMode.token(stream, state.htmlState);
if (!htmlModeMissing) {
var inner = CodeMirror.innerMode(htmlMode, state.htmlState)
if ((inner.mode.name == "xml" && inner.state.tagStart === null &&
(!inner.state.context && inner.state.tokenize.isInText)) ||
(state.md_inside && stream.current().indexOf(">") > -1)) {
state.f = inlineNormal;
state.block = blockNormal;
state.htmlState = null;
}
// #JSX in Script tag requires to disable this
// if ((inner.mode.name == "xml" && inner.state.tagStart === null &&
// (!inner.state.context && inner.state.tokenize.isInText)) ||
// (state.md_inside && stream.current().indexOf(">") > -1)) {
// state.f = inlineNormal;
// state.block = blockNormal;
// state.htmlState = null;
// }
}
return style;
}
Expand Down

0 comments on commit 6a7c019

Please sign in to comment.