asjqkkkk / markdown_widget

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

[Bug] Tab (\t) being replaced with new line (\n) in Pre element #159

Closed PeronGH closed 7 months ago

PeronGH commented 8 months ago

Describe the bug Tab (\t) being replaced with new line (\n) in pre element.

To Reproduce Steps to reproduce the behavior:

  1. Set up wrapper for PreConfig, like this:

    PreConfig(wrapper: (child, code, language) {
    print(json.encode(code));
    return // ...
    })
  2. Try rendering code block including tab:

    
    package main

import "fmt"

func main() { fmt.Println("Hello, World!") }


3. It prints `"package main\n\nimport \"fmt\"\n\nfunc main() {\n\nfmt.Println(\"Hello, World!\")\n}\n"`.

**Expected behavior**
Tab should still be tab.

**Environment:**

• Flutter version 3.16.3 on channel stable at /opt/homebrew/Caskroom/flutter/3.13.6/flutter • Upstream repository https://github.com/flutter/flutter.git • Framework revision b0366e0a3f (9 weeks ago), 2023-12-05 19:46:39 -0800 • Engine revision 54a7145303 • Dart version 3.2.3 • DevTools version 2.28.4 • markdown_widget: 2.3.2+3



**Platform**
Web
asjqkkkk commented 7 months ago

This issue has been fixed by v2.3.2+4