asjqkkkk / markdown_widget

📖Rendering markdown by flutter!Welcome for pr and issue.
MIT License
312 stars 90 forks source link

请问如何添加空行,已经试过连续的\n\n是不行的 #149

Open DeveloperLx opened 8 months ago

DeveloperLx commented 8 months ago

Describe the bug A clear and concise description of what the bug is.

To Reproduce Steps to reproduce the behavior:

  1. Go to '...'
  2. Click on '....'
  3. Scroll down to '....'
  4. See error

Expected behavior A clear and concise description of what you expected to happen.

Screenshots If applicable, add screenshots to help explain your problem.

Environment(please complete the following information): Please use flutter doctor -v to show your flutter environment, and add your markdown_widget version too

Platform Does the problem appear on the Web or on the Mobile

Source data Please provide a minimal source data that can help locating the problem

asjqkkkk commented 8 months ago

@DeveloperLx 你好,连续的\n被trim掉了,如果你需要实现这一效果的话,可能要自定义MarkdownGenerator对象,去解析markdown文件

目前github也是不支持连续\n的,你可以试一试下面这样

aaa

aaa

aaa

aaa

lucasjinreal commented 8 months ago

@asjqkkkk 意思是要这样写吗: \n \n \n?

asjqkkkk commented 8 months ago

@lucasjinreal 你好,只要是 \n,无论什么样的写法,最终都是会被trim掉的,所以可以参考我上面的做法: 自定义MarkdownGenerator对象,去解析markdown文件

lucasjinreal commented 8 months ago

@asjqkkkk 可以给个例子吗,目前这个是刚需,因为LLM输出的\n有一些是必须展示的

asjqkkkk commented 8 months ago

@lucasjinreal 你好,个人时间有限,没有多余的精力为每个自定义需求的issue去编写示例,如果真的有这样的需求,还是建议阅读对应的代码,然后尝试去实现对应功能

150 也是如此,不再赘述

OpenJarvisAI commented 7 months ago

@asjqkkkk 作者您好,现在不hack这个库,直接支持的多行的办法没有了吗?所有的\n看起来都会忽略

asjqkkkk commented 7 months ago

@asjqkkkk 作者您好,现在不hack这个库,直接支持的多行的办法没有了吗?所有的\n看起来都会忽略

或许等下个版本我尝试添加方法来实现这个功能

lucasjinreal commented 7 months ago

@asjqkkkk I am also hoping for it now, it's ommit default by github, but might needed by others since messages in markdown without \n looks like messy

DeveloperLx commented 7 months ago

建议建议提供一个开关,来控制是否trim连续的\n

lucasjinreal commented 7 months ago

It could be better