Open dmitry-margolis opened 1 year ago
Pull requests are welcome. Tried in any new versions of OpenPDF? Does it make a difference if you swap the lines?:
styleSheet.loadStyle("white-text", "color", "#ffffff");
styleSheet.loadTagStyle("p", "color", "#000000");
Describe the bug When parsing HTML content to list of Elements with HTMLWorker.parseToList, styles for HTML classes doesn't override styles for HTML tags.
To Reproduce
Expected behavior Paragraph element will contain chunk with white font.
Additional context I guess problem is within method StyleSheet.applyStyle(String tag, Map<String, String> props) It overrides new style values with old values if they exist (temp.putAll(props);) https://github.com/LibrePDF/OpenPDF/blob/master/openpdf/src/main/java/com/lowagie/text/html/simpleparser/StyleSheet.java#L90