Giter Site home page Giter Site logo

asaaki / cmark.ex Goto Github PK

View Code? Open in Web Editor NEW
94.0 94.0 15.0 1.41 MB

๐Ÿ’ง Elixir NIF for cmark (C), a parser library following the CommonMark spec, a compatible implementation of Markdown.

Home Page: https://hex.pm/packages/cmark

License: MIT License

Makefile 0.30% C 83.85% Elixir 1.33% C++ 14.52%
c cmark commonmark hex markdown nif parser parser-library

cmark.ex's Introduction

Hi there! ๐Ÿ‘‹๐Ÿป

  • ๐Ÿฆ€ I love Rust. Use it as a hobbyist, but work would be cool.
  • ๐Ÿ’Ž I (mainly) work with Ruby, JavaScript, and TypeScript.
  • ๐Ÿณ I use Docker and Kubernetes.
  • ๐ŸŒ I terraform that on AWS.
  • ๐Ÿ‘ช I'm glue. I help and enable and unblock teams.
  • โœ๐Ÿป I blog about stuff at markentier.tech

cmark.ex's People

Contributors

asaaki avatar chrisalley avatar dependabot-preview[bot] avatar dependabot[bot] avatar floriank avatar gmile avatar josevalim avatar kianmeng avatar lowks avatar osbre avatar tvon-a avatar valpackett avatar wojtekmach avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

cmark.ex's Issues

Code Highlighting

I haven't used the Cmark parser before with ExDoc but I tried it because Earmark doesn't support formatting markdown nested inside html tags. Cmark does, but my output has no code highlighting.

Is this expected?

All I've done is add {:cmark, "~> 0.7"} to my deps, add markdown_processor: ExDoc.Markdown.Cmark, and build the docs. You can see the result below:

image

I'm happy to provide additional information if it's helpful!

Thanks

Does not compile on Windows

==> cmark
could not compile dependency :cmark, "mix compile" failed. You can recompile this dependency with "mix deps.compile cmark", update it with "mix deps.update cmark" or clean it with "mix deps.clean cmark"
** (ErlangError) Erlang error: :enoent
    (elixir) lib/system.ex:605: System.cmd("make", [], [stderr_to_stdout: true])

OS: Win10
c compilers installed: VS 2015, clang 4.0
shells tried: git bash, powershell, Developer Command Prompt for VS2015 after running vcvarsall.bat
other notes: both Cmake and Nmake are installed, compiling bcrypt and other NIFs doesn't fail

Add a changelog for cmark releases

First of all, thank you for your great library!

It would be great if cmark.ex kept a changelog of each release, so consumers can easily find what changed.

fenced code blocks still have "```" in the html

hi @asaaki,

Cmark.to_html("```\nTEST\n```")
=> "<pre><code>TEST\n```</code></pre>\n"

I think the "```" in the returned HTML shouldn't be there. If i run cmark from the command line with the same input I get

<pre><code>TEST
</code></pre>

which looks better.

I tried updating the c_src, but I didn't know how to get the .h files from the .h.in files in the cmark repo. I'm also not 100% sure it's a bug in the c code, as I checked out a version of cmark from may and that produced the correct HTML.

Fresh paint for the old house ๐ŸŽจ๐Ÿš

There seem to be still some users out there.
Sadly they have to deal with this relatively unmaintained project.
We should update it a bit.

TODOs:

  • update the C library
  • check if code is still suitable for modern Elixir

Given that it's about C and NIFs also sadly not a very beginner friendly task.

Use bindings for cmark-gfm instead

Folks, what do you think about replacing the bindings for cmark-gfm instead?

It has some extensions, like tables, which we could leave disabled by default. This means we get the commonmark behaviour but there is some extra functionality if someone wants to opt-in?

Release new version?

Would it be possible to release a new version with the changes since 0.6.10? Thanks! :)

A way to white list safe tags when using to_safe_html

Hi,

Right now if you use to_safe_html, it will strip out image tags but imagine a scenario where you're creating a comment box similar to GitHub issues where you want to allow users to upload images.

It would be nice if to_safe_html allowed you to set a list of allowed tags.

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.