Project

General

Profile

Actions

Bug #87992

closed

Not possible to place anchors (without href) in RTE

Added by Thorben Nissen about 5 years ago. Updated over 4 years ago.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
RTE (rtehtmlarea + ckeditor)
Start date:
2019-03-24
Due date:
% Done:

100%

Estimated time:
TYPO3 Version:
10
PHP Version:
Tags:
Complexity:
Is Regression:
Sprint Focus:

Description

In one of my projects (which I'm upgrading from 7 to 9), the customer uses a lot of anchors in longer texts, to enable the visitor to jump back and forth with links in the form of #a-marker-here or #another-marker-there. This is supported by the "anchor" command from CKEditor. Unfortunately TYPO3 always adds an href attribute to it, when saving to or loading from the database, which means, that CKEditor does not recognise it as anchor anymore but as a link.

If the anchor has content (e.g. <a name="special-section">Some special about this</a>) TYPO3 renders a normal link because of the added href. The CKEditor though does not recognise it as an anchor anymore. If the anchor has no content (e.g. <a name="other-important-section"></a>) the link is removed by CKEditor. In the frontend though this is rendered as a link the with current page title as content.

The intended output in the frontend is <a name="some-section">About the project</a>, if I created the anchor with content or <a name="some-section></a> if I created an anchor without content.

Solution: Support anchors without href in HTML parser and typolink function:

Database save/load should not add href
CKEditor should not remove empty anchors
Frontend rendering should not add content to anchors without href

Release: I experienced it with 9.5.5 but from the code, this would be present in master too.

Actions #1

Updated by Gerrit Code Review about 5 years ago

  • Status changed from New to Under Review

Patch set 1 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/60324

Actions #2

Updated by Gerrit Code Review about 5 years ago

Patch set 2 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/60324

Actions #3

Updated by Gerrit Code Review about 5 years ago

Patch set 3 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/60324

Actions #4

Updated by Stephan Großberndt about 5 years ago

  • Status changed from Under Review to Needs Feedback

An empty anchor as <a name="foo"/></a> or <a id="foo"/></a> does make sense as it allows to define markers within the page to jump to via an appended #foo to the url.

@Thorben Nissen can you explain the usecase in a more verbose way?

What is the “anchor command” you're refering to? Is it the old ckeditor plugin? Can you point to some examples or ckeditor docs?

What is the desired output in frontend when having anchor without a href? Is it transformed at some point to have a href or is it rendered without href?

Actions #5

Updated by Thorben Nissen about 5 years ago

  • Description updated (diff)
Actions #6

Updated by Stephan Großberndt about 5 years ago

  • Description updated (diff)

Clarified and formatted description

Actions #7

Updated by Benni Mack almost 5 years ago

  • Target version changed from next-patchlevel to Candidate for patchlevel
Actions #8

Updated by Gerrit Code Review over 4 years ago

  • Status changed from Needs Feedback to Under Review

Patch set 4 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/60324

Actions #9

Updated by Gerrit Code Review over 4 years ago

Patch set 5 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/60324

Actions #10

Updated by Gerrit Code Review over 4 years ago

Patch set 6 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/60324

Actions #11

Updated by Gerrit Code Review over 4 years ago

Patch set 1 for branch 9.5 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/62226

Actions #12

Updated by Thorben Nissen over 4 years ago

  • Status changed from Under Review to Resolved
  • % Done changed from 0 to 100
Actions #13

Updated by Benni Mack over 4 years ago

  • Status changed from Resolved to Closed
Actions

Also available in: Atom PDF