diff --git a/regression_testing/cases/access-cases/case-1006.conf b/regression_testing/cases/access-cases/case-1006.conf new file mode 100644 index 000000000..8911097d5 --- /dev/null +++ b/regression_testing/cases/access-cases/case-1006.conf @@ -0,0 +1,4 @@ +keep-tabs: yes +output-xhtml: yes +show-info: no +force-output: yes diff --git a/regression_testing/cases/access-cases/case-1006@0.html b/regression_testing/cases/access-cases/case-1006@0.html new file mode 100644 index 000000000..99ef3fbbd --- /dev/null +++ b/regression_testing/cases/access-cases/case-1006@0.html @@ -0,0 +1,16 @@ + + +
+
+
+func sup() {
+ print("hello")
+ return
+}
+
+
+
+
diff --git a/regression_testing/cases/access-expects/case-1006.html b/regression_testing/cases/access-expects/case-1006.html
new file mode 100644
index 000000000..1493e322b
--- /dev/null
+++ b/regression_testing/cases/access-expects/case-1006.html
@@ -0,0 +1,17 @@
+
+
+
+
+
+func sup() {
+ print("hello")
+ return
+}
+
+
+
+
diff --git a/regression_testing/cases/access-expects/case-1006.txt b/regression_testing/cases/access-expects/case-1006.txt
new file mode 100644
index 000000000..9fbbf4b27
--- /dev/null
+++ b/regression_testing/cases/access-expects/case-1006.txt
@@ -0,0 +1,2 @@
+No warnings or errors were found.
+
diff --git a/src/lexer.c b/src/lexer.c
index b0afccdab..35b783178 100644
--- a/src/lexer.c
+++ b/src/lexer.c
@@ -2516,7 +2516,7 @@ static Node* GetTokenFromStream( TidyDocImpl* doc, GetTokenMode mode )
AttVal *attributes = NULL;
Node *node;
Bool fixComments;
-
+
switch ( cfgAutoBool(doc, TidyFixComments) )
{
case TidyYesState:
@@ -2542,6 +2542,16 @@ static Node* GetTokenFromStream( TidyDocImpl* doc, GetTokenMode mode )
while ((c = TY_(ReadChar)(doc->docIn)) != EndOfStream)
{
+ // Check to see if we're in a pre, if so, don't worry about whitespace
+ Node *parent = lexer->parent;
+ while (parent) {
+ if (nodeIsPRE(parent)) {
+ mode = Preformatted;
+ }
+
+ parent = parent->parent;
+ }
+
if (lexer->insertspace)
{
TY_(AddCharToLexer)(lexer, ' ');