asjqkkkk / markdown_widget

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

Copy not enabled by default #131

Closed luohao123 closed 6 months ago

luohao123 commented 11 months ago

Hi, I have a markdow widget using geneator likethis:

Column( crossAxisAlignment: CrossAxisAlignment.start, children: MarkdownGenerator( linesMargin: EdgeInsets.zero, // generators: [videoGeneratorWithTag, latexGenerator],, config: isDark ? MarkdownConfig.darkConfig.copy( configs: _getMarkdownConfigs( isDark, bodyTextStyle, codeWrapper, ), ) : MarkdownConfig.defaultConfig.copy( configs: _getMarkdownConfigs( isDark, bodyTextStyle, codeWrapper, ), ), ).buildWidgets(message.text), ),

but the copy mode not ready default.

asjqkkkk commented 11 months ago

Hi @luohao123 , you need use SelectionArea to enable selecting

luohao123 commented 11 months ago

thank u! every helpful!! I used SelectionArea it worked. But one moer quesiton.

SelectionArea( child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: MarkdownGenerator( linesMargin: EdgeInsets.zero, generators: [videoGeneratorWithTag, latexGenerator], config: isDark ? MarkdownConfig.darkConfig.copy( configs: _getMarkdownConfigs( isDark, bodyTextStyle, codeWrapper, ), ) : MarkdownConfig.defaultConfig.copy( configs: _getMarkdownConfigs( isDark, bodyTextStyle, codeWrapper, ), ), ).buildWidgets(message.text), ), ),

I using liek this, make the genreator like in your example folder, add latex and video support.

But

image

latex not showing, is the format not right? The inline latex should showing

asjqkkkk commented 11 months ago

Hi @luohao123 , please provider the source data to locate the issue

luohao123 commented 11 months ago

hello, the text is above text

asjqkkkk commented 11 months ago

@luohao123 you should also pass the inlineSyntaxList: [LatexSyntax()]

luohao123 commented 11 months ago

@asjqkkkk hi, MarkdownGenerator( linesMargin: EdgeInsets.zero, generators: [videoGeneratorWithTag, latexGenerator], inlineSyntaxList: [LatexSyntax()],

there is no such params in Generator

asjqkkkk commented 11 months ago

@luohao123 please have a look with https://github.com/asjqkkkk/markdown_widget/blob/master/example/lib/markdown_custom/latex.dart

you need to fetch the example code, then you'll konw how to use it