php-markdown icon indicating copy to clipboard operation
php-markdown copied to clipboard

Support for ids on list items

Open scito opened this issue 12 years ago • 4 comments

Markdown Extra supports ids and classes for headers. I suggest to have a similar feature for list items.

I have a use case where I set anchors for list items, e.g. in a list of books. From other parts of my site, I reference a specific book.

scito avatar Feb 04 '13 10:02 scito

I'd like to, but I'm still wondering how the syntax would work. This is especially puzzling for list items with block-level elements (paragraphs, code, etc.).

michelf avatar Feb 07 '13 12:02 michelf

Markdown is simple and it`s great but i need this feature too)

Possible realization: For setting header attributes we use ## Header 2 ## {#header2}

To make list we use: * Item So we can make list with attributes like this %% Item %% {#header2}

%% -- start/end list item

funivan avatar May 07 '13 14:05 funivan

An idea for the syntax:

* {#id1 .class1} List item 1
* {#id2 .class2} List item 2

The curly braces would come directly after the list item symbol.

Is this feasible?

scito avatar Aug 31 '13 08:08 scito

@scito Perhaps there's no better way, but it doesn't look very appealing. It'd be better if the curly braces could be after the item (like for headers and definition terms). Only, that won't work very well if the item has block-level content.

There's nothing right now that can have attributes and can have block-level content. I think that's the problem to solve.

michelf avatar Aug 31 '13 16:08 michelf