Coder Social home page Coder Social logo

Comments (10)

 avatar commented on July 26, 2024

At least 3 workarounds are available for this "problem", so I would say leave it.

$ cat a.md
Hello world
{:.text-link .ref}

Hello world
{:class="text-link ref"}

Hello world
{:.text-link}
{:.ref}

$ kramdown a.md
<p class="text-link ref">Hello world</p>

<p class="text-link ref">Hello world</p>

<p class="text-link ref">Hello world</p>

from kramdown.

lydell avatar lydell commented on July 26, 2024

You're right in putting quotation marks around the word problem—it's not such a big deal. Usually I avoid adding attributes at all. And, yes, there are workarounds. But that's just about a third of the issue.

from kramdown.

 avatar commented on July 26, 2024

In fact, the idiom for using a space between classes is already clearly shown in the kramdown doc, and reinforced in the maruku doc

More in particular, an attribute list is a whitespace-separated list of elements

from kramdown.

lydell avatar lydell commented on July 26, 2024

That's right! That is how I found out how to correct my first kramdown code block above.

Is doing it exactly like Maruku a big concern? That is not the case currently anyway, since kramdown requires values to be quoted (key=val is not supported), and IALs cannot be put on the same line as a heading.

from kramdown.

gettalong avatar gettalong commented on July 26, 2024

The syntax and idea of ALDs and IALs came from Maruku originally but the current kramdown syntax is not compatible to the Maruku syntax. So compatibility with Maruku would not be a big concern for me.

As for warnings: As stated on the syntax page, anything inside of {: ... } that does not follow one of the current rules, is ignored, without warning on purpose.

As for omitting the space between class/id names: Will have a look at it. I think adjusting the regexps will probably do the trick.

from kramdown.

lydell avatar lydell commented on July 26, 2024

As for warnings: As stated on the syntax page, anything inside of {: ... } that does not follow one of the current rules, is ignored, without warning on purpose.

Yes, the documentation is superb: Nicely styled, easy to read and seemingly covering everything. I still suggest warnings. How is just ignoring ever useful? It's not like anyone would think "now, lets put some crap in this IAL too, just for fun". The only time "crap" is present, is when the writer has made a mistake. I would be much more helpful if a warning was shown, instead of trying to spot the error manually.

Link id errors are already helpfully warned for.

$ kramdown
A link to [Google].

[goog1e]: http://google.com/
^Z
<p>A link to [Google].</p>

Warning: No link definition for link ID 'google' found

Why can't IALs and ALDs be helpful too?

from kramdown.

gettalong avatar gettalong commented on July 26, 2024

A warning will now be shown when an IAL/ALD contains no valid attributes.

As for allowing the new syntax: After looking at it, this involves a bit more than just modifying the regexps. Patches are welcome because I currently have no time for looking deeper into this.

from kramdown.

lydell avatar lydell commented on July 26, 2024

A warning will now be shown when an IAL/ALD contains no valid attributes.

That's better. It solves the original test case (but not, as you mention, a mix of valid and invalid, such as {:.a.b .c}, which would be better).

As for allowing the new syntax: After looking at it, this involves a bit more than just modifying the regexps. Patches are welcome because I currently have no time for looking deeper into this.

If it's too much work—don't bother, since we've got warnings now (and that excellent documentation).

If I knew ruby, I would definitely take a stab at both points. :)

from kramdown.

gettalong avatar gettalong commented on July 26, 2024

The problem with allowing #id.class.class2 and the like is that... oh, wait, I think I might have just thought of an easy and fast solution 😄... will try it later and write again

from kramdown.

gettalong avatar gettalong commented on July 26, 2024

Yep, works. Will be in the next release.

from kramdown.

Related Issues (20)

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.