#4039 closed defect (fixed)
Document Browser does not honour linebreaks in info layer for text type
Reported by: | Dietmar Winkler | Owned by: | Adeel Asghar |
---|---|---|---|
Priority: | high | Milestone: | 1.11.0 |
Component: | OMEdit | Version: | v1.11.0 |
Keywords: | Cc: |
Description
In case somebody decides to not use html for the Documentation.info
annotation then the Document Browser will simply not honour linebreaks.
See Modelica.Math.Matrices.LAPACK.dgeev
as an example.
Change History (13)
comment:1 by , 8 years ago
Milestone: | Future → 1.11.0 |
---|---|
Resolution: | → fixed |
Status: | new → closed |
comment:3 by , 8 years ago
Confirmed to be working. Only one thing. When somebody uses text type documentation it is most likely that person as monospaced text in mind and hence arranges it as such. LAPACK for example has a lot of multiline matrix documentation that is all wrong with variable width fonts.
I suggest for the text only content mono-spaced font should be used.
comment:4 by , 8 years ago
It's a bit hard to detect if text is HTML or plain-text. Qt::mightBeRichText doesn't guarantee anything.
Perhaps we should use monospaced font as default.
comment:5 by , 8 years ago
monospaced as default is fine for me. As for detection, doesn't all HTML in Modelica have to be enclosed in <html> ... </html>
? So that should be easy to detect.
comment:6 by , 8 years ago
Detection is easy and pretty fast but not true always. For example you can have something like this,
annotation(Documentation(info="This is plain text \n <p>We also have html here</p>"));
Qt::mightBeRichText
will return false for above code.
I will make monospaced as default.
comment:7 by , 8 years ago
Your example would not be HTML ;-) The correct way to mix text and HTML would be to tell were HTML starts. So your example should look like:
annotation(Documentation(info="This is plain text \n <html><p>We also have html here</p></html>"));
to be legal. This is btw what I use in some of my models.
comment:8 by , 8 years ago
So how do you want the above text to be displayed as HTML or as plaintext?
comment:9 by , 8 years ago
All that is not HTML should be displayed as mono-spaced text and only what's inside <html> ... </html>
should be rendered as HTML. Was that your question?
comment:11 by , 8 years ago
Yes of course. Fonts are also mixed within HTML. I.e., pre
would also be monospaced within HTML and HTML can also contain different font types.
Fixed in 7ed1ea5/OMEdit.