Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

support php-markdown-extra abbreviations #197

Open
sunaku opened this Issue · 10 comments

8 participants

Suraj N. Kurapati Robin Dupret Matt Rogers Adam Prescott Rémi Paul Robert Lloyd Mathias Bynens Brandon Weiss
Suraj N. Kurapati

Hello,

Please add support for abbreviations like php-markdown-extra.

Thanks for your consideration.

Robin Dupret
Collaborator

Hum, it doesn't seem to be in the Markdown specs. I think PHP-Markdown-extra is just an overlay to basic markdown with stuff which aren't in the specs. What do you think @mattr- ?

Matt Rogers
Collaborator

I think we should consider adding support for this in the same way that Redcarpet supports other extensions.

Adam Prescott

Isn't the risk that the number of supported Markdown extensions grows over time? All part of Redcarpet means added ongoing maintenance cost. There's also the possibility that two extensions might conflict or do the same thing in different ways; how do you pick the preferred syntax for demarcating, say, abbreviations, if there are two conflicting such syntaxes?

(Not saying I wouldn't like more features in Markdown, of course, but the lack of a proper spec makes this problematic. :frowning:)

Matt Rogers
Collaborator

Yes, that is a risk. If there are conflicting syntaxes or conflicting extensions, then we'll need to make a decision about how to handle it. We could find another conflicting extension and decide not to support this particular syntax. We could also introduce a feature i'm going to call 'markdown styles' where one would be able to choose which flavors of markdown to use and only get the features from that flavor. There are many ways to provide support for this one particular feature, once we choose to actually start implementing it. :smile:

Rémi

+1

Any updates on this? Would very much like to see Markdown Extras in Redcarpet.

Paul Robert Lloyd

For those looking to mark up abbreviations without resorting to HTML, this plugin might be a better fit: https://github.com/kogakure/jekyll-plugin-abbr (chiefly because it allows you to define a dictionary of abbreviations, saving you having to list them at the bottom of each document.)

Mathias Bynens

The PHP Markdown docs (linked to above) is down, so I’ll post the documentation on how it deals with abbreviations here:


Abbreviations

Markdown Extra adds supports for abbreviations (HTML tag <abbr>). How it works is pretty simple: create an abbreviation definition like this:

*[HTML]: Hyper Text Markup Language
*[W3C]:  World Wide Web Consortium

Then, elsewhere in the document, write text such as:

The HTML specification
is maintained by the W3C.

…and any instance of those words in the text will become:

The <abbr title="Hyper Text Markup Language">HTML</abbr> specification
is maintained by the <abbr title="World Wide Web Consortium">W3C</abbr>.

Abbreviations are case-sensitive, and will span on multiple words when defined as such. An abbreviation may also have an empty definition, in which case <abbr> tags will be added in the text but the title attribute will be omitted:

Operation Tigra Genesis is going well.

*[Tigra Genesis]:

Abbreviation definitions can be anywhere in the document. They are stripped from the final document.


@kogakure’s jekyll-plugin-abbr is nice but not quite the same.

Brandon Weiss

Any update on this? I'd normally be happy to do it myself, but the C code is beyond me.

Brandon Weiss

I made an extension for Redcarpet that renders abbreviations.

Suraj N. Kurapati

:+1: Hooray! Thank you @brandonweiss :bow:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.