Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dynamic title attribute for markdown footnotes #27388

Open
wants to merge 2 commits into
base: trunk
Choose a base branch
from

Conversation

edent
Copy link
Contributor

@edent edent commented Nov 14, 2022

Fixes #27387

Quick conformance test:

Lorem ipsum dolor sit amet[^latin]. These footnotes support Markdown[^md] and HTML[^html]. They don't choke on entities[^ent]! And quote marks are fine[^q]. What about very long footnotes[^long]? Fully multilingual[^zh] and Unicode[^🥰] compatible.

[^latin]: Other Latin texts are available
[^md]: Some Markdown *emphasis* and a [link](https://example.com)
[^html]: Using <em>HTML</em>
[^ent]: Entity support & or &amp;? < or &lt;
[^q]: "
[^long]: Sensors indicate no shuttle or other ships in this sector. According to coordinates, we have travelled 7,000 light years and are located near the system J-25. Tractor beam released, sir. Force field maintaining our hull integrity. Damage report? Sections 27, 28 and 29 on decks four, five and six destroyed. Without our shields, at this range it is probable a photon detonation could destroy the Enterprise.
[^zh]: 威廉 莎士比亚
[^🥰]: 🥰

Fixes #27387

Changes proposed in this Pull Request:

  • Footnotes have a title attribute which displays a tooltip. This is now set to the contents of the footnote.

Other information:

  • Have you written new tests for your changes, if applicable?
  • Have you checked the E2E test CI results, and verified that your changes do not break them?

Jetpack product discussion

Does this pull request change what data or activity we track or use?

Testing instructions:

Write a Markdown post with the following text:

Lorem ipsum dolor sit amet[^latin]. These footnotes support Markdown[^md] and HTML[^html]. They don't choke on entities[^ent]! And quote marks are fine[^q]. What about very long footnotes[^long]? Fully multilingual[^zh] and Unicode[^🥰] compatible.

[^latin]: Other Latin texts are available
[^md]: Some Markdown *emphasis* and a [link](https://example.com)
[^html]: Using <em>HTML</em>
[^ent]: Entity support & or &amp;? < or &lt;
[^q]: "
[^long]: Sensors indicate no shuttle or other ships in this sector. According to coordinates, we have travelled 7,000 light years and are located near the system J-25. Tractor beam released, sir. Force field maintaining our hull integrity. Damage report? Sections 27, 28 and 29 on decks four, five and six destroyed. Without our shields, at this range it is probable a photon detonation could destroy the Enterprise.
[^zh]: 威廉 莎士比亚
[^🥰]: 🥰

Publish the post and place your cursor over the footnote links.

Fixes Automattic#27387 

Quick conformance test:

```
Lorem ipsum dolor sit amet[^latin]. These footnotes support Markdown[^md] and HTML[^html]. They don't choke on entities[^ent]! And quote marks are fine[^q]. What about very long footnotes[^long]? Fully multilingual[^zh] and Unicode[^🥰] compatible.

[^latin]: Other Latin texts are available
[^md]: Some Markdown *emphasis* and a [link](https://example.com)
[^html]: Using <em>HTML</em>
[^ent]: Entity support & or &amp;? < or &lt;
[^q]: "
[^long]: Sensors indicate no shuttle or other ships in this sector. According to coordinates, we have travelled 7,000 light years and are located near the system J-25. Tractor beam released, sir. Force field maintaining our hull integrity. Damage report? Sections 27, 28 and 29 on decks four, five and six destroyed. Without our shields, at this range it is probable a photon detonation could destroy the Enterprise.
[^zh]: 威廉 莎士比亚
[^🥰]: 🥰
```
@github-actions github-actions bot added the [Plugin] Jetpack Issues about the Jetpack plugin. https://wordpress.org/plugins/jetpack/ label Nov 14, 2022
@github-actions
Copy link
Contributor

github-actions bot commented Nov 14, 2022

Thank you for your PR!

When contributing to Jetpack, we have a few suggestions that can help us test and review your patch:

  • ✅ Include a description of your PR changes.
  • ✅ All commits were linted before commit.
  • ✅ Add testing instructions.
  • ✅ Specify whether this PR includes any changes to data or privacy.
  • ✅ Add changelog entries to affected projects

This comment will be updated as you work on your PR and make changes. If you think that some of those checks are not needed for your PR, please explain why you think so. Thanks for cooperation 🤖


The e2e test report can be found here. Please note that it can take a few minutes after the e2e tests checks are complete for the report to be available.



Jetpack plugin:

  • Next scheduled release: January 3, 2023.
  • Scheduled code freeze: December 26, 2022.

@github-actions github-actions bot added [Status] Needs Author Reply We would need you to make some changes or provide some more details about your PR. Thank you! OSS Citizen This Pull Request was opened by an Open Source contributor. labels Nov 14, 2022
@jeherve jeherve added [Type] Bug When a feature is broken and / or not performing as intended [Feature] Markdown [Status] Needs Review To request a review from Crew. Label will be renamed soon. [Pri] Low and removed [Status] Needs Author Reply We would need you to make some changes or provide some more details about your PR. Thank you! labels Dec 7, 2022
@jeherve
Copy link
Member

jeherve commented Dec 7, 2022

Related discussion: michelf/php-markdown#387

@anomiex
Copy link
Contributor

anomiex commented Dec 19, 2022

I like the idea, but let's see what comes out of the upstream discussion. I see several good points raised there.

@anomiex anomiex added [Status] Blocked / Hold and removed [Status] Needs Review To request a review from Crew. Label will be renamed soon. labels Dec 19, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Feature] Markdown OSS Citizen This Pull Request was opened by an Open Source contributor. [Plugin] Jetpack Issues about the Jetpack plugin. https://wordpress.org/plugins/jetpack/ [Pri] Low [Status] Blocked / Hold [Type] Bug When a feature is broken and / or not performing as intended
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Enhancement: Dynamic title attribute on Markdown Footnote links
3 participants