Menu

#2311 Export as HTML default style unreadable with dark background

Bug
closed-fixed
nobody
5
2022-02-09
2022-01-27
No

Platform: Windows 7 x64

export.html.wysiwyg=1

Uses a parent span tag to enclose the exported code with the style from the head tag. Text inherits from this tag unless enclosed with span tags with a class attribute to override.

export.html.wysiwyg=0

Uses a parent pre tag to enclose the exported code with the style from the head tag. Text inherits from this tag unless enclosed with span tags with a class attribute to override.


Notice the difference between the 2 settings that I descibed, the parent tags span and pre are swapped. These tags are swapped in the body, yet are not swapped in the head in the css styles.

The default colour for text in a html file is usually black. If the background is black, then the text becomes unreadable if export.html.wysiwyg=0.

This patch fixes the issue:

--- a/src/ExportHTML.cxx
+++ b/src/ExportHTML.cxx
@@ -157,7 +157,11 @@

                if (sd.specified != StyleDefinition::sdNone) {
                    if (istyle == StyleDefault) {

-                       fprintf(fp, "span {\n");
+                       if (wysiwyg) {
+                           fprintf(fp, "span {\n");
+                       } else {
+                           fprintf(fp, "pre {\n");
+                       }
                    } else {
                        fprintf(fp, ".S%0d {\n", istyle);
                    }

Discussion

  • Neil Hodgson

    Neil Hodgson - 2022-01-27
    • labels: scite --> scite, export
    • status: open --> open-fixed
     
  • Neil Hodgson

    Neil Hodgson - 2022-01-27

    Committed as [db2daa] .

     

    Related

    Commit: [db2daa]

  • Neil Hodgson

    Neil Hodgson - 2022-02-09
    • status: open-fixed --> closed-fixed
     

Log in to post a comment.

MongoDB Logo MongoDB