From bdea21a87e7b54747ced9f913659e0e2fe6590c6 Mon Sep 17 00:00:00 2001 From: Thibaut Cuvelier Date: Tue, 18 Aug 2020 04:56:25 +0200 Subject: [PATCH] DocBook: improve comments. --- src/xml.h | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/xml.h b/src/xml.h index 0948143c57..69d582d0fd 100644 --- a/src/xml.h +++ b/src/xml.h @@ -39,7 +39,7 @@ struct CR; class XMLStream { public: /// - explicit XMLStream(odocstream & os): os_(os), escape_(ESCAPE_ALL), is_last_tag_cr_(false) {} + explicit XMLStream(odocstream & os): os_(os), escape_(ESCAPE_ALL), is_last_tag_cr_(true) {} /// odocstream & os() { return os_; } /// @@ -82,7 +82,7 @@ public: enum EscapeSettings { ESCAPE_NONE, ESCAPE_AND, // meaning & - ESCAPE_ALL, // meaning <, >, &, at present + ESCAPE_ALL, // meaning <, >, &, at present, except things that are forbidden in comments ESCAPE_COMMENTS // Anything that is forbidden within comments }; /// Sets what we are going to escape on the NEXT write. @@ -98,7 +98,9 @@ public: bool isTagOpen(xml::EndTag const &, int maxdepth = -1) const; /// bool isTagPending(xml::StartTag const &, int maxdepth = -1) const; - /// + /// Is the last tag that was added to the stream a new line (CR)? This is mostly to known + /// whether a new line must be added. Therefore, consider that an empty stream just had a CR, + /// that simplifies the logic using this code. bool isLastTagCR() const { return is_last_tag_cr_; }; /// void writeError(std::string const &) const; -- 2.39.5