ID attributes are stripped after saving an edit
- Dominant language
- JavaScript
- Stars
- 20k
- Forks
- 1.1k
- Avg merge
- 3d 12h
- Merged PRs (30d)
- 13
Description
Starting from imported HTML that contains footnotes (anchor links within the document), any attempt to edit the document causes the IDs to be stripped from the page elements that have them. This renders the anchor links (which are not altered in the process) useless.
Because the anchor links from imported Word documents follow a predictable naming scheme, I was able to use JavaScript in the browser to restore their function. But this is not ideal, because the pattern could change in the future, and render my hack obsolete. Trix seems to also treat classnames the same way, stripping them off when it finds them.
##### Steps to Reproduce
1. Import valid HTML text into Trix's ActiveRecord column (do not use the front-end editor for this step).
2. Open that record for editing using the Trix editor, and make any change, to any part of the content.
3. Save.
4. Notice that the anchors no longer work, because their targets have lost their IDs.
##### Details
* Trix version: 1.2.3
* Browser name and version: Safari/Firefox/Chrome (evergreen, latest versions)
* Operating system: Mac OS 10.14.6
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.