slab / quill

Quill is a modern WYSIWYG editor built for compatibility and extensibility
https://quilljs.com
BSD 3-Clause "New" or "Revised" License
43.67k stars 3.39k forks source link

Generated Heading ids create conflicts #700

Closed sachinrekhi closed 8 years ago

sachinrekhi commented 8 years ago

I noticed that an id tag is automatically generated on h1, h2, h3 tags by using the text of the actual heading. The issue I'm experiencing is that sometimes the generated ids are clashing with existing ids I've defined elsewhere on the page and in my CSS.

The ramifications of this is you now have multiple elements with the same id (which isn't good) as well as a styling conflict where the inappropriate style may be applied.

I assume you've added the ids for table of contents or other such outlining behavior?

Could we say add a prefix to the generated ids to reduce the chance of such conflicts? say "ql-" or "ql-header-"?

Platforms: Chrome 50 on Mac 10.11

Version: Quill 1.0 Beta 2

jhchen commented 8 years ago

I think I might just remove this id generation feature. It was partially motivated to have Parchment/Blots do something more interesting but seems like not an innocuous feature.

sachinrekhi commented 8 years ago

That works!

rickhanlonii commented 7 years ago

@jhchen without this, is it possible to set the heading IDs if desired (for linking to headers)?