Skip to content

Commit fc00092

Browse files
committed
Code cleanup
1 parent 7fca6db commit fc00092

2 files changed

Lines changed: 5 additions & 10 deletions

File tree

editor/html2format.cpp

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -17,15 +17,11 @@
1717
*/
1818

1919

20+
#include <database/logs.h>
2021
#include <editor/html2format.h>
22+
#include <filter/quill.h>
2123
#include <filter/string.h>
22-
#include <filter/url.h>
23-
#include <filter/usfm.h>
24-
#include <locale/translate.h>
25-
#include <styles/logic.h>
26-
#include <database/logs.h>
2724
#include <pugixml/utils.h>
28-
#include <filter/quill.h>
2925

3026

3127
void Editor_Html2Format::load (std::string html)
@@ -36,8 +32,8 @@ void Editor_Html2Format::load (std::string html)
3632
// The web editor produces <hr> and other elements following the HTML specs,
3733
// but the pugixml XML parser needs <hr/> and similar elements.
3834
html = filter::string::html2xml (html);
39-
40-
std::string xml = "<body>" + html + "</body>";
35+
36+
const std::string xml = "<body>" + html + "</body>";
4137
// Parse document such that all whitespace is put in the DOM tree.
4238
// See https://pugixml.org/docs/manual.html for more information.
4339
// It is not enough to only parse with parse_ws_pcdata_single, it really needs parse_ws_pcdata.

editor/html2format.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@
2020
#pragma once
2121

2222
#include <config/libraries.h>
23-
#include <database/styles.h>
2423
#pragma GCC diagnostic push
2524
#pragma GCC diagnostic ignored "-Weffc++"
2625
#pragma GCC diagnostic ignored "-Wsuggest-override"
@@ -41,7 +40,7 @@ class Editor_Html2Format
4140
std::vector <std::string> texts {};
4241
std::vector <std::string> formats {};
4342
private:
44-
pugi::xml_document document {}; // DOMDocument holding the html.
43+
pugi::xml_document document {}; // DOMDocument holding the HTML.
4544
void preprocess ();
4645
void postprocess ();
4746
void process ();

0 commit comments

Comments
 (0)