小编Dig*_*ine的帖子

Flutter Html 视图在导入时返回错误

我已经成功地在 pubspec.yaml 中安装了依赖项,退出代码为 0。当我import 'package:flutter_html_view/flutter_html_view.dart';显示它已通过 vs 代码导入时(它强调它为已导入但未使用)**

但是当我保存或重新启动我的模拟器时,它会拒绝构建。返回以下错误:

/C:/src/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_markdown-0.2.0/lib/src/builder.dart:326:49: Error: The getter 'children' isn't defined for the class 'InlineSpan'.

 - 'InlineSpan' is from 'package:flutter/src/painting/inline_span.dart' ('/C:/src/flutter/packages/flutter/lib/src/painting/inline_span.dart').
Try correcting the name to the name of an existing getter, or defining a getter or field named 'children'.
        List<TextSpan> children = previous.text.children != null
                                                ^^^^^^^^
/C:/src/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_markdown-0.2.0/lib/src/builder.dart:327:41: Error: The getter 'children' isn't defined for the class 'InlineSpan'.

 - 'InlineSpan' is from 'package:flutter/src/painting/inline_span.dart' ('/C:/src/flutter/packages/flutter/lib/src/painting/inline_span.dart').
Try correcting the name to the name of an existing …
Run Code Online (Sandbox Code Playgroud)

dart flutter

5
推荐指数
1
解决办法
269
查看次数

wp_insert_post() 与 PHP 的 HTML 标签

这个问题似乎没有答案。我发现自己陷入了困境。就这样

我在使用 WP API 插入带有 HTML 标签的帖子时遇到问题。

我使用的方法是:wp_insert_post(),内容如下:

$content = "<p> <img src="img-link"> </p> <p> Hi, this is an example of the content.</p> <a class="dl" href="link-address"> Link Name</a>";

我发布帖子时想要的结果是:

必要时应用 html 的格式化帖子。

但当我发布帖子时得到的结果是:

<p> <img src="img-link"> </p> <p> Hi, this is an example of the content.</p> <a class="dl" href="link-address"> Link Name</a>

当我转到 WP 编辑器直接编辑同一篇文章时,可视化编辑器看起来格式良好,符合预期

然后我导航到文本编辑器,也看到格式良好:

<p> <img src="img-link"> </p> <p> Hi, this is an example of the content.</p> <a class="dl" href="link-address"> Link Name</a>

很明显这就是我真正想要的。但是,当我按照前面所述从我的 php 文件中发布这篇文章时,我得到了这个发布:

<p> <img …

html php wordpress

2
推荐指数
1
解决办法
1943
查看次数

标签 统计

dart ×1

flutter ×1

html ×1

php ×1

wordpress ×1