Closed ghost closed 6 years ago
I agree with the direction of these changes, but I think if there needs to be extra vertical space between content and source (or other formatting), that should be done in CSS. All my notes have something like <div>{{Text}}</div><div>{{Source}}</div>
, with div
padding added via the stylesheet.
Also, does the change to setField
actually make any difference? It's only used with new notes, so there is never any existing content, right?
You're probably right, but I don't know how to do that... Would you mind doing the change?
As for setField
, there can already be existing content in one case: if the text and the source are pasted to the same field.
Okay, so I'll do a manual merge and a bit of testing. My suspicion is that there's no situation where you really want text and source in the same field. But let me play around with it a bit.
I've pushed the changes. Let me know what you think.
I will update the IR3 template to include the source field by default, and update model.css
with some decent styling.
For the situation where you are extracting to, e.g., the cloze type, just clone it and do something like div { margin: 20px auto }
in the styling section, and have:
<div>{{cloze:Text}}</div>
<div>Source: {{Extra}}</div>
in the back template.
Looks good!
I'll see that when you update the template and model.css
, but it's not a big deal anyway.
The blank line before '(source: ...)' is deliberate. If the Cloze type is used with the source in the 'Extra' field, it visually separates the text from the source; and whatever the note type, if the user wants to write something before the source in the same field, it's faster.