DanXi icon indicating copy to clipboard operation
DanXi copied to clipboard

[Feature Request] Markdown 支持代码高亮

Open w568w opened this issue 2 years ago • 1 comments

在 Markdown 渲染中增加对代码块高亮的支持,以便提高可读性。

实现方法可参考 https://github.com/flutter/flutter/issues/81755

w568w avatar Oct 26 '23 17:10 w568w

原 issue 中提到的 flutter_highlight 最后更新是 2021 年,其 fork 版 flutter_highlighting 也已经停止维护约 10 个月。我的建议是迁移到支持代码高亮的 Markdown 库,markdown_widget

w568w avatar Mar 13 '24 11:03 w568w

@cryindevil Are you going to do this recently? If you aren't, maybe I'll have a try.

HydrogenC avatar Sep 14 '24 01:09 HydrogenC

@cryindevil Are you going to do this recently? If you aren't, maybe I'll have a try.

Sure, I may not implementing it recently @HydrogenC

boyu-zhu avatar Sep 14 '24 16:09 boyu-zhu

@w568w @singularity-s0
On the website of flutter_markdown it says:

By default, Markdown is not selectable. A caller may use the following ways to customize the selection behavior of Markdown: Set selectable to true, and use onTapText and onSelectionChanged to handle tapping and selecting events. Set selectable to false, and wrap Markdown with SelectionArea or SelectionRegion.

It seems that there's official support for SelectionArea, so is the fork https://github.com/singularity-s0/flutter_markdown_selectable still necessary?

HydrogenC avatar Sep 16 '24 02:09 HydrogenC

This may no longer be necessary. You can test this yourself.

singularity-s0 avatar Sep 16 '24 04:09 singularity-s0