nytimes / Emphasis

Dynamic Deep-Linking and Highlighting
open.nytimes.com
576 stars 70 forks source link

Unable to deep link to ordered/unordered lists #3

Open joeybaker opened 13 years ago

joeybaker commented 13 years ago

The handy paragraph symbol doesn't appear next to ol or ul. It also doesn't seem possible to highlight any text that appears in lists.

dgw commented 13 years ago

That's customizable by making a copy of the script and editing the this.paraSelctors definition on line 48 of emphasis-src.js.

But the primary version should probably be extended to allow highlighting and linking to lists and other non-paragraph elements.

donohoe commented 12 years ago

Yes and No. Lists are not Paragraphs, therefore no "P" symbol as thats not technically correct. I originally debated whether to include OL and UL (and also Header tags) but decided not too for simplicities sake. I'm not opposed to re-visiting that if enough people make a case for it.

joeybaker commented 12 years ago

I recognize that the ¶ symbol isn't technically correct for lists, but I'd think that list items are a pretty popular thing that people might want to link to, no?

donohoe commented 12 years ago

I agree however list items are not always text and this was primarily focused on just text. Often lists are of links, images and other items. I'm not sure how easy it would be to add UL and OL but I will look into it (or you could fork the project and do so...).

joeybaker commented 12 years ago

Ah, yes! Hadn't considered non-text lists. That's a good point. I'll give it some thought. Perhaps it should only apply to lists wrapped in a <p>?

donohoe commented 12 years ago

Yes, you could do that - but - P tags cannot contain block-level elements - which covers UL and OL

http://htmlhelp.com/reference/html40/block/p.html

joeybaker commented 12 years ago

ah! yup, right you are.

Perhaps if a list is a sibling of a <p>?