GithubHelp home page GithubHelp logo

python-markdown / github-links Goto Github PK

View Code? Open in Web Editor NEW
11.0 5.0 10.0 28 KB

Python-Markdown GitHub Links Extension

Home Page: https://pypi.org/project/mdx-gh-links/

License: Other

Python 100.00%
github markdown python-markdown

github-links's Issues

Feature request: Support config for URL_BASE

This could be useful for GitHub Enterprise setups (or even Gitlab).

The current workaround is:

import mdx_gh_links

mdx_gh_links.URL_BASE = 'https://ghe.bigcorp.com'
        
m = markdown.markdown(
  some_input,
  extensions=[mdx_gh_links.GithubLinks()],
)

Text in links should be ignored.

If text is already in a link, it should be ignored. For example. if a document were to contain...

[@waylan](https://example.com/waylan)

The link would be parsed (as it should), and then this extension would parse the link label (@waylan) and nest a second link inside the first one, resulting in the following:

<a href="https://example.com/waylan">
    <a class="gh-link gh-mention" 'href="https://github.com/waylan" title="GitHub User: @waylan">@waylan</a>
</a>

In addition to the wierdness of the nested links, notice that the first link is not a GitHub mention, but something else. Of course as a workaround, you can escape the mention, like this:

[\@waylan](https://example.com/waylan)

But it should be smart enough to not insert a link inside another link. The problem is that Python-Markdown doesn't really provide a way to check that (inline patterns have no access to their parent). And it gets potentially more complicated when there is multiple levels of nesting. Consider this:

[**@waylan**](https://example.com/waylan)

The direct parent is not a link (<a> tag), but an ancestor is. Therefore, the behavior should be the same as if the direct parent was a link.

Latest release is failing (0.4)

Latest release is failing to pick up issues and author references in the form of #123 or @seanbudd

set up:

Markdown==3.5.1
mdx_truly_sane_lists==1.3
markdown-link-attr-modifier==0.2.1
mdx-gh-links==0.4

Note 0.3.1 works fine

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.