Problem/Motivation

When using plain text, allow editors to enter the reference text content between the <footnotes> tags rather than in the data attribute. Entering within the data attribute would be too complicated for a content editor to write that HTML as it means escaping their content for the attribute context.

Issue fork footnotes-3414604

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

John_B created an issue. See original summary.

scott_euser’s picture

Status: Active » Postponed (maintainer needs more info)

Can you provide steps/screenshot('s) of how you want to use it? Is it source editing or actual unformatted text? Can you provide example markup of what you expect to work that is being escaped.

john_b’s picture

Here is a typical footnote

<fn>

"Budget: 1,694,339.00 (USD)" <a href="https://www.malariaconsortium.org/what-we-do/projects/19/support-scale-up-of-seasonal-malaria-chemoprevention-smc">Malaria Consortium, "Support Scale up of Seasonal Malaria Chemoprevention (SMC)," 2015</a>. We also searched the Gates Foundation's grant database to see whether it made any additional grants to Malaria Consortium for SMC work, but only saw this grant (grant page available at <a href="https://www.gatesfoundation.org/about/committed-grants">Gates Foundation</a>, "Malaria Consortium").


"Malaria Consortium is implementing and assessing the feasibility of a community-based seasonal malaria chemoprevention (SMC) project in Katsina state, northern Nigeria, with funding from the Bill & Melinda Gates Foundation. Following new World Health Organisation policy recommendations on SMC, this project administers full antimalarial treatments during the malaria season in areas with highly seasonal malaria transmission, to prevent illness among children under five."


"The project’s objectives are:
<ul>
<li>To design, in consultation with key local stakeholders, an appropriate community-based delivery system for SMC in Katsina state based on formative research, which will review aspects relating to feasibility, community acceptability, effectiveness and cost
<li>To launch and execute SMC delivery according to the selected delivery system and collect data on process indicators and costs
<li>To evaluate community acceptability, costs and effectiveness of the delivery system for SMC
<li>To inform future national and state plans for SMC continuation/ scale up by disseminating findings and sharing experiences with key stakeholders"
</ul>

<a href="https://www.malariaconsortium.org/media-download-file/201310110601/-/smc_project-brief-10oct2.pdf">Malaria Consortium, Project Brief: Seasonal malaria chemoprevention, Katsina</a>, pp. 1-2. 

</fn> 

You can see this working correctly on our site. It is currently footnote 59 at https://www.givewell.org/charities/malaria-consortium

Here is the output of the coverted text, which has three problems:
The @...@ delimiters are still there but do not work;
The space at start and end are converted to

tags in 4.x and not in 3.x;
The HTML entities would be a nightmare for content editors to enter, since they create raw HTML.

<footnotes data-value="" data-text="

&lt;ul&gt;
&lt;li&gt;&quot;Budget: 1,694,339.00 (USD)&quot; @Malaria Consortium, &quot;Support Scale up of Seasonal Malaria Chemoprevention (SMC)&quot;@. We also searched the Gates Foundation&#039;s grant database to see whether it made any additional grants to Malaria Consortium for SMC work, but only saw this grant (grant page available at @Gates Foundation, &quot;Malaria Consortium&quot;@).
&lt;li&gt;&quot;Malaria Consortium is implementing and assessing the feasibility of a community-based seasonal malaria chemoprevention (SMC) project in Katsina state, northern Nigeria, with funding from the Bill &amp; Melinda Gates Foundation. Following new World Health Organisation policy recommendations on SMC, this project administers full antimalarial treatments during the malaria season in areas with highly seasonal malaria transmission, to prevent illness among children under five.&quot; @Malaria Consortium, Project Brief: Seasonal malaria chemoprevention, Katsina@, Pg 1.
&lt;li&gt;&quot;The project’s objectives are:&lt;ul&gt;
&lt;li&gt;To design, in consultation with key local stakeholders, an appropriate community-based delivery system for SMC in Katsina state based on formative research, which will review aspects relating to feasibility, community acceptability, effectiveness and cost
&lt;li&gt;To launch and execute SMC delivery according to the selected delivery system and collect data on process indicators and costs
&lt;li&gt;To evaluate community acceptability, costs and effectiveness of the delivery system for SMC
&lt;li&gt;To inform future national and state plans for SMC continuation/ scale up by disseminating  findings and sharing experiences with key stakeholders&quot; @Malaria Consortium, Project Brief: Seasonal malaria chemoprevention, Katsina@, Pg 2.
&lt;/ul&gt;
&lt;li&gt;It appears that this project may have also been related to another major (&amp;pound;89 million) project that Malaria Consortium was working on in Nigeria called &quot;Support to National Malaria Programme (SuNMaP)&quot;. 
&lt;ul&gt;
&lt;li&gt;&quot;Support to National Malaria Programme (SuNMaP) is an &amp;pound;89 million UK aid funded project that works with the government and people of Nigeria to strengthen the national effort to control malaria. The programme began in April 2008 and [ended] in March 2016.

Led by Malaria Consortium, SuNMaP was jointly managed by a consortium, including lead partners Health Partners International and GRID Consulting, with nine other implementing partners. SuNMaP was implemented in 10 states across Nigeria, including Anambra, Kano, Niger, Katsina, Ogun, Lagos, Jigawa, Enugu, Kaduna and Yobe.

SuNMaP worked with the Nigerian government&#039;s National Malaria Elimination Programme (NMEP) to harmonise donor efforts and funding agencies around national policies and plans for malaria control. Project targets were aligned with the National Malaria Strategic Plan and Global Malaria Action Plan. The project aimed to improve national, state and local government level capacity for the prevention and treatment of malaria.&quot; @Malaria Consortium, SuNMaP Final Report@, Pg 38.
&lt;li&gt;&quot;July 2013: Result of SuNMaP study on efficacy of sulphadoxine‐pyrimethamine (SP) for intermittent treatment against malaria in pregnancy published. SuNMaP commences seasonal malaria chemoprevention in Katsina State.&quot; @Malaria Consortium, SuNMaP Final Report@, Pg 16.
&lt;/ul&gt;
&lt;/ul&gt;

"></footnotes>

On the same page, footnote 81 (and many others) have a real apostrophe in "Consortium’s" which is not converted by the drush command. Enter one of those in a footnote when using version 4.x, and that footnote (sometimes all foonotes) break.

john_b’s picture

delete

scott_euser’s picture

Status: Postponed (maintainer needs more info) » Active

Thanks for the details. It's certainly not stable yet so there is no commitment to breaking changes in 4x - therefore it is fine and makes sense to as closely as possible match 3x output (while still fixing the various big issues that 3x could never solve like grouping/ama support/wysiwyg support within source, accessibility).

Will work on this as soon as I can. Really appreciate you taking the time to thoroughly test out 4x!

john_b’s picture

I am grateful that you are so responsive. A look around our content heavy site will show many examples of complex footnotes. Whether we should use a WYSIWYG is an open question, but if Drupal works without one, Footnotes ideally should too.

scott_euser’s picture

First thought is probably the simplest solution is to support putting content within <footenotes data-value="5">source test here<footnotes/> rather than only supporting data-text. Then perhaps upgrade path can accept as an arg where you want to move the source text to, defaulting to data-text since I would guess the majority of sites use wysiwyg vs not (though I have no data to back that up).

To note it probably does need to be data-value and not value as noted in #3391021: Data loss in old 3x version of module: everything before last colon in every footnote is lost when using <fn> instead of [fn] syntax, otherwise it seems some characters cause significant issues.

Will have a bit more of a think about it, and of course also happy to hear your suggestions / opinion.

scott_euser’s picture

scott_euser’s picture

Title: The need to replace punctuation with entity refs makes 4.x virtually unusable » Support adding the text content within the <footnotes> element

scott_euser’s picture

Status: Active » Needs review

This does not support converting from plain text to CK Editor 5 based text format though. Perhaps that can be a follow-up as its maybe more of an edge case. Can you check if this MR works for you @John_B?

scott_euser’s picture

Issue summary: View changes

Updated issue summary

scott_euser’s picture

scott_euser’s picture

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.