Closed (fixed)
Project:
Footnotes
Version:
4.0.0-alpha1
Component:
Footnotes
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
8 Jan 2024 at 11:16 UTC
Updated:
20 Feb 2024 at 06:29 UTC
Jump to comment: Most recent
Comments
Comment #2
scott_euser commentedComment #3
scott_euser commentedComment #5
scott_euser commentedThis seems to work fine for me, but really needs testing by others to confirm this helps them upgrade sites.
Comment #6
john_b commentedWorks for simple use cases, thanks.
Problems:
1. Where content creators have added space at start and end of footnote text, inside tags, this space needs to be removed. Footnotes 4.x converts that space to
tags, and 3.x does, so our content creatores often wrap text in line breaks for clearer layout of HTML layout. Content creators do not want the upgraded footnotes to add a paragraphs at start and end of footnotes, where 3.x had none.
2. The drush command converts ' fake apostrophes to HTML entity references but does not covert real apostrophes ’ (which some fonts print as forward sloping ticks). Our content creators prefer real apostrophes even though standard English keyboards do not have a key for them. So long as normal punctuation breaks Footnotes 4.x, and #3414604: Support adding the text content within the <footnotes> element remains unfixed, all punctuation which breaks footnotes would need to be converted by an upgade command.
Comment #7
scott_euser commentedSorry for being a pain but here again can you provide example markup you are running this against + actual vs expected output after the drush command? It would make it much easier for me to work on this.
Thanks!
Comment #8
john_b commentedHere is a piece of HTML outputted by the drush command.
<footnotes data-value="" data-text="@Malaria Consortium’s seasonal malaria chemoprevention program: Philanthropy report 2020@, Pg. 5."></footnotes>I don't what the expected output is. I do know that the inclusion of a real apostrophe in
Consortium’sas distinct from a fake / keyboard apostrophe, is enough to break footnotes when using 4.x but not when using 3.x.You can see an example of the extra space at start and end of the footnote text at https://www.drupal.org/project/footnotes/issues/3414604#comment-15397449. If 4.x. is going to turn this extra space into
<p>tags, in a way that 3.x. did not, that space should be removed, and documetation should warn content creators to stop adding such space for clearer layout in their HTML source editing window.Comment #9
scott_euser commentedI do not fully understand what you mean with the extra space thing. Can you explain further? Thanks!
Comment #10
scott_euser commentedTo note
Does not cause any
<p>tag wrappers. So perhaps sorted when #3414604: Support adding the text content within the <footnotes> element gets in?Comment #11
scott_euser commentedPutting this back to needs review. Probably issues raised when not using CK Editor by @John_B are sorted in #3414604: Support adding the text content within the <footnotes> element and a follow-up issue can be made to provide a drush command that gives the option to put the reference text like
<footnotes data-value="">content here</footnotes>instead of<footnotes data-value="" data-text="content here"></footnotes>.Comment #12
scott_euser commentedFor @John_B drush upgrade command for that is in #3416959: Combined: Support adding the text content within the <footnotes> element + Drush upgrade path for 3x to 4x
Comment #13
scott_euser commentedFixed as per combined merge request in #3416959: Combined: Support adding the text content within the <footnotes> element + Drush upgrade path for 3x to 4x.
Comment #14
john_b commentedMany thanks. I finally got round to testing. Sorry about the delay.
This does not work where there is a line break before the start of the footnote text.
For example, this works:
Here is some body text.<footnotes data-value="">Here is some footnote text.</footnotes>When editors are working without WYSYWIG, they will add line breaks for better layout.
Editors may also add line breaks within footnote text. For example:
When using the above, including one or more line breaks before, after, or within the footnote text, the footnotes are empty. DBlog says
Warning: DOMDocumentFragment::appendXML(): ^ in Drupal\footnotes\Plugin\Filter\FootnotesFilter->process() (line 161 of /home/website/dev_html/web/modules/contrib/footnotes/src/Plugin/Filter/FootnotesFilter.php)Enabling / disabling the 'convert line breaks to p tags' filter makes no difference.
Comment #15
john_b commentedSeparate issue, but I am also concerned if we upgrade footnotes using this drush command, and a year later the content creators decide they want to start using CDEditor.
Comment #16
scott_euser commentedThanks John_B, sounds clear, I have moved it to a follow-up child issue rather than re-opening and added your details #3419353: Trim footnotes text via drush command upgrade path from 3.x to 4.x.
Comment #17
scott_euser commentedApologies missed this:
Yes you can see my comment here. I created an issue for that here and added instructions in case someone wants to tackle it.