Bug 404616 - Okular turns "(C)" into copyright symbol iin markdown document
Summary: Okular turns "(C)" into copyright symbol iin markdown document
Status: RESOLVED FIXED
Alias: None
Product: okular
Classification: Applications
Component: general (show other bugs)
Version: 1.6.2
Platform: Neon Linux
: NOR normal
Target Milestone: ---
Assignee: Okular developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-02-20 19:46 UTC by Peter Ped Helcmanovsky
Modified: 2019-03-30 22:52 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
Test Markdown file showing the reported behaviour (334 bytes, text/markdown)
2019-02-20 19:46 UTC, Peter Ped Helcmanovsky
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Peter Ped Helcmanovsky 2019-02-20 19:46:57 UTC
Created attachment 118232 [details]
Test Markdown file showing the reported behaviour

SUMMARY

Okular does show text "(C)" in Markdown document as copyright symbol (which interferes with technical documentation about assembly instructions of Z80 CPU).

It is not part of original Markdown syntax, but it seems to be introduced by the "discount" library used for Markdown in Okular, which includes also "smartypants" substitutions, where the (C) substitute is defined.

STEPS TO REPRODUCE
1. Open the attached "test_c.md" in Okular

OBSERVED RESULT

The text "OUT (C),B" shows copyright symbol instead of text.

ADDITIONAL INFORMATION

It is possible to configure "discount" library to NOT do smartypants substitutions (command line option "-f nopants" or there is some code define `MKD_NOPANTS`), but the only option in Okular backend configuration for Markdown  is the font...

So it seems it would be possible to add the smartypant filtering as option in backend configuration, making it by default ON like it is now (I can easily admit my issue is somewhat rare... but real).
Comment 1 Nate Graham 2019-02-22 22:31:42 UTC
Might be worth an option in the Markdown Backend configuration UI. Would you like to submit a patch? Here's the documentation:

https://community.kde.org/Get_Involved/development

https://community.kde.org/Infrastructure/Phabricator
Comment 2 Albert Astals Cid 2019-02-28 00:06:03 UTC
https://phabricator.kde.org/D19405
Comment 3 Albert Astals Cid 2019-03-30 22:52:01 UTC
Git commit fe0c8ad7c97fa9e108c5ab017829fb493f78bb6f by Albert Astals Cid.
Committed on 30/03/2019 at 22:51.
Pushed by aacid into branch 'master'.

MarkDown: Enable option to disable smartypants formatting

Subscribers: okular-devel

Tags: #okular

Differential Revision: https://phabricator.kde.org/D19405

M  +20   -0    core/textdocumentgenerator.cpp
M  +6    -0    core/textdocumentgenerator.h
M  +37   -14   generators/markdown/converter.cpp
M  +11   -3    generators/markdown/converter.h
M  +32   -0    generators/markdown/generator_md.cpp
M  +7    -0    generators/markdown/generator_md.h

https://commits.kde.org/okular/fe0c8ad7c97fa9e108c5ab017829fb493f78bb6f