Repository navigation
Allow formatting question and form descriptions using markdown - #1394
Conversation
|
@susnux just a quick question: is there a reason why you moved the title handling to the mixin? I think that the css styles need some more love... at least currently for me the layout moves when I switch between edit and view mode... |
Because it is duplicated code / shared code between the create and submit view.
What kind of move? If the input is just plain text there should be no difference, but of cause markdown and the rendered output might take different space and so there might be movement. |
|
Yes that makes sense... But you also did a switch from textarea to input and textarea to NcRichContenteditable. So there's probably some other CSS applied to those elements |
|
@susnux I think I found the source of the jumping: forms/src/components/Questions/Question.vue Line 373 in 458bea1 I disabled this rule in the dev tools and the jumping between edit and view is gone... Could you please verify this (for one line descriptions) and put it into the PR? |
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
458bea1 to
c2159cc
Compare
@Chartman123 I can verify this was the cause, I removed that rule and pushed it to this PR. No jumping here anymore :) |
There was a problem hiding this comment.
So for me it's fine now :)
Perhaps @jotoeri will find some time to review as well
jotoeri
left a comment
There was a problem hiding this comment.
- Newlines in the description get lost
- FormHead still jumps around between edit/view
- Having no border on the question description, the same should apply to the form description. Or the other way round, i fear we have to move to borders on all, since one otherwise does not see the mode change within the header.
|
I will work through this points tomorrow.
This is because simple newlines are soft breaks in markdown so this is expected behavior you will have to use double newlines or hardbreaks (backslash+newline or two space + newline). But I think we will have to migrate old descriptions to markdown for this, I will also have a look at this topic tomorrow. By the way I want to thank you for your work, your reviews are very in depth, sadly a rare thing on open source projects :) |
MD-it has the |
|
Sorry for the delay, had some busy weeks, but I have some time for this now :) |
bc66d8b to
5a32110
Compare
|
@jotoeri I think I resolved all review notes 🚀 |
4884bdf to
e7f139f
Compare
|
I think this ready to go now :) |
01b4b96 to
638a435
Compare
|
@susnux: Just a little thing that I saw right now: In your question edit screenshot the textboxes for the descriptions/options are a little bit wider than the title. I don't know if this was also before, but perhaps you can have a look at this :) Apart from that, I will do a more intensive review later 👍🏻 |
|
Chartman123
left a comment
There was a problem hiding this comment.
One more comment on the package-lock.json. Rest seems fine
@Chartman123 @susnux any opinions? |
That's basically the same in main and there since Forms 3 iirc
No, can't reproduce here.
Yes, same here... didn't try this before, but yes: should be linked
Confirm, I think the description element should be condtionally shown only if there is some text. This is also true for empty question descriptions. This seems to be related to the text handling. If you click into a description field with just the placeholder the cursor goes to the end and if you then press enter you get two newlines... 🙈 |
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## main #1394 +/- ##
============================================
+ Coverage 35.47% 35.83% +0.35%
+ Complexity 532 520 -12
============================================
Files 52 51 -1
Lines 2224 2202 -22
============================================
Hits 789 789
+ Misses 1435 1413 -22 |
|
I fall into line :)
I can remove this but I think this would be better placed in a follow up PR as it is unrelated, but I do not think this is bad as it makes clear what is the question header and what the body.
I agree, fixed that.
Same, pushed a commit which fixes this :) |
Well, 'unrelated' depends - you increased the offset from 2px to 4px in this PR, instead of aligning the description to the existing field...
That's strange... I still see it on my Firefox 109 but not on edge. 🤔 |
|
@susnux wanna rebase & squash the commits here? Then we can merge it. |
Nice you released the hotfix update :) |
* Supports Markdown on the description fields. * Also fixed space of description if no text is entered to prevent jumping between submit and edit view. * Align question title and description input borders with options * Always toggle edit mode of `title` and `description` together * Only show description if necessary Signed-off-by: Ferdinand Thiessen <rpm@fthiessen.de>
|
Are these changes included in version 3.0.4? I have 3.0.4 installed, and none of the above Markdown stuff works for me. Trying to add a URL to a question and/or description and it displays the raw text, not MD formatted. |
|
No this will be included with upcoming 3.1.0 release. |
|
Thank you @susnux. Is there a place where I can watch the project timeline? I need this urgently for a project, so if needed be, I will build the app from source code to have this capability. But don't want to build from source if 3.1.0 is imminent. |
|
I do not think there is a fixed schedule, but I am not into that topic, maybe @jotoeri can help. |
|
Yes, there generally is no fixed release schedule for forms. But we anyways have to release for NC26 within the next 3 days. Maybe i'll find some time later, otherwise tomorrow. Edit: Done |






This will allow users to use markdown (CommonMark) for formatting descriptions (both form and question).
See also this recording for example usage:
voko.mp4
Details
Original video (outdated): https://user-images.githubusercontent.com/1855448/198033394-49cbb74b-3ba0-4180-8660-5c17f4a76235.mp4