matthewwithanm / matthewwithanm/python-markdownify

Allow different symbols for em and strong

Open
#251 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
2.2k
Forks
203
PR merge metrics
No merged PRs in 30d

Description

strong_em_symbol allows to define a symbol for both, but not separately.

Here's a problem: consider:

<em>a</em><strong>.b</strong>

Here's how it can be converted to markdown and the commonmark interpretation:

<!--
<em>a</em>**.b**
-->
*a***.b**

<!--
<em>a</em>__.b__
-->
_a___.b__

<!--
<em>a</em><strong>.b</strong>
-->
_a_**.b**

https://babelmark.github.io/?text=*a***.b**%0A%0A_a___.b__%0A%0A_a_**.b**

As you can see, only the third option works, but the lib doesn't provide such option.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by tracing the strong_em_symbol option through the HTML-to-Markdown conversion path and reproduce the three examples from the issue. Define separate symbols for em and strong so the third CommonMark-compatible output is possible, then verify the examples produce the intended Markdown.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
tooling
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.