TF-2591 Run js script on paste with HtmlEditor

This commit is contained in:
DatDang
2024-02-29 11:14:57 +07:00
committed by Dat H. Pham
parent 98894b4245
commit 80a32559d9
2 changed files with 19 additions and 0 deletions
+9
View File
@@ -7,6 +7,15 @@ import 'package:flutter/material.dart';
import 'package:universal_html/html.dart' as html;
class HtmlUtils {
static const lineHeight100Percent = (
script: '''
document.querySelectorAll("*")
.forEach((element) => {
if (element.style.lineHeight !== "normal")
element.style.lineHeight = "100%";
});''',
name: 'lineHeight100Percent');
static String customCssStyleHtmlEditor({TextDirection direction = TextDirection.ltr}) {
if (PlatformInfo.isWeb) {
return '''