Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit abcb382

Browse files
committed
(texi2html.py): Minor improvement to HTML 3.0 output for code examples.
1 parent 893e5e0 commit abcb382

3 files changed

Lines changed: 21 additions & 6 deletions

File tree

Doc/texi2html.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1269,7 +1269,7 @@ def bgn_example(self, args):
12691269
self.nofill = self.nofill + 1
12701270
self.write('<PRE>')
12711271
def end_example(self):
1272-
self.write('</PRE>')
1272+
self.write('</PRE>\n')
12731273
self.nofill = self.nofill - 1
12741274

12751275
bgn_lisp = bgn_example # Synonym when contents are executable lisp code
@@ -1434,8 +1434,13 @@ def bgn_quotation(self, args): self.write('<BQ>')
14341434
def end_quotation(self): self.write('</BQ>\n')
14351435

14361436
def bgn_example(self, args):
1437+
# this use of <CODE> would not be legal in HTML 2.0,
1438+
# but is in more recent DTDs.
14371439
self.nofill = self.nofill + 1
1438-
self.write('<PRE CLASS=example>')
1440+
self.write('<PRE CLASS=example><CODE>')
1441+
def end_example(self):
1442+
self.write("</CODE></PRE>\n")
1443+
self.nofill = self.nofill - 1
14391444

14401445
def bgn_flushleft(self, args):
14411446
self.nofill = self.nofill + 1

Doc/tools/texi2html.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1269,7 +1269,7 @@ def bgn_example(self, args):
12691269
self.nofill = self.nofill + 1
12701270
self.write('<PRE>')
12711271
def end_example(self):
1272-
self.write('</PRE>')
1272+
self.write('</PRE>\n')
12731273
self.nofill = self.nofill - 1
12741274

12751275
bgn_lisp = bgn_example # Synonym when contents are executable lisp code
@@ -1434,8 +1434,13 @@ def bgn_quotation(self, args): self.write('<BQ>')
14341434
def end_quotation(self): self.write('</BQ>\n')
14351435

14361436
def bgn_example(self, args):
1437+
# this use of <CODE> would not be legal in HTML 2.0,
1438+
# but is in more recent DTDs.
14371439
self.nofill = self.nofill + 1
1438-
self.write('<PRE CLASS=example>')
1440+
self.write('<PRE CLASS=example><CODE>')
1441+
def end_example(self):
1442+
self.write("</CODE></PRE>\n")
1443+
self.nofill = self.nofill - 1
14391444

14401445
def bgn_flushleft(self, args):
14411446
self.nofill = self.nofill + 1

Tools/scripts/texi2html.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1269,7 +1269,7 @@ def bgn_example(self, args):
12691269
self.nofill = self.nofill + 1
12701270
self.write('<PRE>')
12711271
def end_example(self):
1272-
self.write('</PRE>')
1272+
self.write('</PRE>\n')
12731273
self.nofill = self.nofill - 1
12741274

12751275
bgn_lisp = bgn_example # Synonym when contents are executable lisp code
@@ -1434,8 +1434,13 @@ def bgn_quotation(self, args): self.write('<BQ>')
14341434
def end_quotation(self): self.write('</BQ>\n')
14351435

14361436
def bgn_example(self, args):
1437+
# this use of <CODE> would not be legal in HTML 2.0,
1438+
# but is in more recent DTDs.
14371439
self.nofill = self.nofill + 1
1438-
self.write('<PRE CLASS=example>')
1440+
self.write('<PRE CLASS=example><CODE>')
1441+
def end_example(self):
1442+
self.write("</CODE></PRE>\n")
1443+
self.nofill = self.nofill - 1
14391444

14401445
def bgn_flushleft(self, args):
14411446
self.nofill = self.nofill + 1

0 commit comments

Comments
 (0)