Giter Site home page Giter Site logo

Comments (9)

Orc avatar Orc commented on September 26, 2024

It would be easy to add a compile time option (I don't want to add a runtime option because I'm creeping up on the limits of what I can add to a 32 bit flag word) for reverting to id= (I'm not sure why the W3C decided to depreciate name= and force namespace collisions; perhaps they're planning on depreciating #styles?)

I replaced the + character in anchors because it's not a legal character for xhtml id=
(and probably not for xhtml name=); If I changed that, it would most certainly have to be a compile-time option.

from discount.

theory avatar theory commented on September 26, 2024

I think name is deprecated because:

  1. It's not unique.
  2. It appears only in anchor elements, and you should be able to link to anything.

I guess I'm okay with compile-time options; I'd just have to keep a couple of different versions around. Might be nice at some point, though, to allow more common command-line options, at least, so that instead of markdown -F 0x1000 I could do something like markdown --this --that --the-other (I don't remember what 0x1000 is, and have to read the source to find out, IIRC). I dunno, as a hacker (but not a C hacker), I don't see why there should be any such limitation.

Anyway, I do prefer id= and would like to be able to update older stuff without links changing.

Cheers,

David

from discount.

theory avatar theory commented on September 26, 2024

Thanks for responding, and taking my request under consideration. Greatly appreciated.

from discount.

Orc avatar Orc commented on September 26, 2024

The markdown program has supported named options for quite some time now. markdown -ftoc is the same as markdown -F0x1000.

But take a look at the commits I've just pushed out; they may do the job for you.

from discount.

theory avatar theory commented on September 26, 2024

Thanks. Somehow I missed -ftoc. Is there a --help option equivalent? I don't know where that's documented.

Your commit does look like exactly what I was hoping for, thanks! Just tried it, though, and got:

> markdown -ftoc --with-id-anchor meta/spec.txt
markdown: illegal option -- -
usage: markdown [-dTV] [-b url-base] [-F bitmap] [-f {+-}flags] [-o ofile] [-s text] [-t text] [file]

How does one specify such options?

Thanks,

David

from discount.

theory avatar theory commented on September 26, 2024

Oh, it's a configure.sh option. Duh, sorry, trying agin.

from discount.

theory avatar theory commented on September 26, 2024

--with-id-anchor works great, thanks! Rebuilding to try --with-anchor-default=+ now…

Side note: Looks like make distclean leaves behind librarian.sh.

Looks good, although I see now that there have been other changes that change the anchors. Ah well, I guess I'll just rewrote the code I wrote that parses it to parse the new format using ..

Much appreciated change, BTW. --with-id-anchor is a huge help.

—David

from discount.

Orc avatar Orc commented on September 26, 2024

I'm going to end up reverting the --with-anchor-default code, because it's difficult to test properly (I have to jump through hoops to get the constant into a form that can be stuffed into a version string so I can detect it later.) The attempts to properly xhtmlify the code is what made the format of the anchor title change, sorry!

from discount.

theory avatar theory commented on September 26, 2024

No problem. I've decided not to use it because so much else has changed anyway (i.e., replacing all non-alphanumeric characters with the separator).

One thing you might consider changing about the ID generation, however, is ignoring sub-elements. For example, I have Markdown like this:

### `ok( boolean, description )` ###

The ID created for that is L.code.ok..boolean..description....code.. Kind of awful that the <code> sub-element is included. I think that ok..boolean..description.. would make a lot more sense. Thoughts?

Thanks again!

David

from discount.

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.