Git Product home page Git Product logo

sort-markdown-footnotes's People

Contributors

derdennis avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

sort-markdown-footnotes's Issues

SyntaxError

I have an output error
I do :

cat test_fn.md | sort_footnotes > beautiful-text.markdown

output :

  File "/usr/bin/sort_footnotes", line 52
    print text
    ^^^^^^^^^^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?

What can I do ?
Am no a python pro.
Thanks, great tool idea

Adjacent links problem

Hey, sorry for necrobumping your repository, I just found it very useful but noticed a probably unwanted behavior given the following situation:

lalala [^fn1][^fn2]

Caused by the following regex:

link = re.compile(r'[^(?<=\n)](\[\^fn([\d]+)\])')

Seems like the engine refuses to accept [^fn2] as (\[\^fn([\d]+)\]) because [^fn1] was already captured, so its last character can't be reused in the next expression?

That could lead to data loss, as these links' labels will be ignored and erased from the file.

Anyway, I guess there can be a couple of solutions:

  • Warn users about this particular situation
  • Before the actual sorting happens, find and fix this situation by adding spaces between the links (my favorite solution ๐Ÿ˜‰)
  • Pull out some flashy regex-fu and change the above expression to somehow take into account these situation

What do you think? :)

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.