Implement diffing html messages in the edit history
This commit is contained in:
parent
84e2333105
commit
3753e5261d
7 changed files with 345 additions and 45 deletions
|
@ -17,6 +17,7 @@ limitations under the License.
|
|||
|
||||
import { MATRIXTO_URL_PATTERN } from '../linkify-matrix';
|
||||
import { walkDOMDepthFirst } from "./dom";
|
||||
import { checkBlockNode } from "../HtmlUtils";
|
||||
|
||||
const REGEX_MATRIXTO = new RegExp(MATRIXTO_URL_PATTERN);
|
||||
|
||||
|
@ -118,21 +119,6 @@ function checkDecendInto(node) {
|
|||
}
|
||||
}
|
||||
|
||||
function checkBlockNode(node) {
|
||||
switch (node.nodeName) {
|
||||
case "PRE":
|
||||
case "BLOCKQUOTE":
|
||||
case "DIV":
|
||||
case "P":
|
||||
case "UL":
|
||||
case "OL":
|
||||
case "LI":
|
||||
return true;
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
function checkIgnored(n) {
|
||||
if (n.nodeType === Node.TEXT_NODE) {
|
||||
// riot adds \n text nodes in a lot of places,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue