Open nicolasfranck opened 2 years ago
@nicolasfranck It has been suggested by @briri that you have patched this already. Is it possible to send a PR?
@johnpinto1 not really. Word is not HTML, and there is no way put everything in bold just by wrapping it between <strong>
tags. Apparently that only works with regular text. Maybe we just allow too much in the question text? There will always be a case where someone constructs HTML in that rich text editor that is not allowed in docx. Maybe someone puts an entire table in bold? And it possibly breaks the html layout you put it in.
Ahh ok. @nicolasfranck have your users encountered the issue more than just this one occasion? We have only seen it happen once in the DMPTool.
I ask this because if has only happened a few times then we may want to place this issue in the backlog because it will possibly be a lot of effort and there are more pressing issues we should address.
@nicolasfranck Thanks for the quick clarification.
It hasn't happen a lot. But it is something to take into account when making an interface for entering questions: do we want our users to markup the title of a question knowing that the entered markup will possibly break the intended markup in the resulting html page.
@briri I think @nicolasfranck makes a good suggestion. I will work on removing any markup for question text. We can then discuss if what I do is a sutable solutioin.
Please complete the following fields as applicable:
What version of the DMPRoadmap code are you running? (e.g. v2.2.0)
3.1.1
Behaviour:
Depending on the html in
Question#text
(see https://github.com/DMPRoadmap/roadmap/blob/master/app/views/shared/export/_plan.erb#L45), the result of<strong><%= question.text %></strong>
fails when exporting to docx. A non working docx is returnedSteps to reproduce:
Put this in your question text (replace
*
by bullets in the editor):Now it tries to convert
but that fails. Removing the
<br>
helps. Removing<strong>
altogether too.cf. https://github.com/DMPRoadmap/roadmap/blob/master/app/views/shared/export/_plan.erb#L45 cf. https://github.com/karnov/htmltoword/issues/73