Bug 460526

Summary: the editor area (not the preview) show pandoc table in strange format
Product: [Applications] ghostwriter Reporter: LL <lingwangneuraleng>
Component: generalAssignee: megan.conkle
Status: CLOSED NOT A BUG    
Severity: normal    
Priority: NOR    
Version First Reported In: unspecified   
Target Milestone: ---   
Platform: Ubuntu   
OS: Linux   
Latest Commit: Version Fixed/Implemented In:
Sentry Crash Report:
Attachments: table-in-editing-area

Description LL 2022-10-16 10:39:08 UTC
Created attachment 152887 [details]
table-in-editing-area

SUMMARY
***
NOTE: If you are reporting a crash, please try to attach a backtrace with debug symbols.
See https://community.kde.org/Guidelines_and_HOWTOs/Debugging/How_to_create_useful_crash_reports
***

The preview result (pandoc style) is totally fine. However, in the editor area, it shows very strange format as attached image.



STEPS TO REPRODUCE
1. just copied the table example direct from pandoc documentation:
```
-------------------------------------------------------------
 Centered   Default           Right Left
  Header    Aligned         Aligned Aligned
----------- ------- --------------- -------------------------
   First    row                12.0 Example of a row that
                                    spans multiple lines.

  Second    row                 5.0 Here's another one. Note
                                    the blank line between
                                    rows.
-------------------------------------------------------------

Table: Here's the caption. It, too, may span
multiple lines.
```

OBSERVED RESULT
as attachment

EXPECTED RESULT
either plain text without bold/heading or some kind of table editor dialog

SOFTWARE/OS VERSIONS
Windows: 
macOS: 
Linux/KDE Plasma: 
(available in About System)
KDE Plasma Version: 
KDE Frameworks Version: 
Qt Version: 

ADDITIONAL INFORMATION
Comment 1 megan.conkle 2022-10-19 01:43:07 UTC
My apologies for the confusion.  This is actually expected behavior since the syntax highlighting is handled by cmark-gfm, which does not support the Pandoc table extensions.  The highlighter is instead seeing these tables as setext headings.  One workaround would be for you change the settings to not use large headings.  (It will still be bold.)  I don't want to add highlighting for Pandoc-specific extensions since I would like to maintain a means of warning the end user that their Markdown is not portable/compatible with other Markdown processors.
Comment 2 LL 2022-10-19 12:28:13 UTC
(In reply to megan.conkle from comment #1)
> My apologies for the confusion.  This is actually expected behavior since
> the syntax highlighting is handled by cmark-gfm, which does not support the
> Pandoc table extensions.  The highlighter is instead seeing these tables as
> setext headings.  One workaround would be for you change the settings to not
> use large headings.  (It will still be bold.)  I don't want to add
> highlighting for Pandoc-specific extensions since I would like to maintain a
> means of warning the end user that their Markdown is not portable/compatible
> with other Markdown processors.

Is it possible to turn off the syntax highlighting completely at the editing area?