Skip to content

Commit 98dc8e9

Browse files
committed
Changed the call arguments for submission tool conversion from XML to v3 text to match those of the standalone tool. Fixes an issue where <sourecode> would have line ends stripped when converted by the datatracker.
- Legacy-Id: 17021
1 parent 68b0e42 commit 98dc8e9

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

ietf/submit/forms.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,7 @@ def format_messages(where, e, log):
182182
# --- Parse the xml ---
183183
try:
184184
parser = xml2rfc.XmlRfcParser(str(tfn), quiet=True)
185-
self.xmltree = parser.parse(normalize=True)
185+
self.xmltree = parser.parse(remove_comments=False, quiet=True, add_xmlns=True)
186186
self.xmlroot = self.xmltree.getroot()
187187
xml_version = self.xmlroot.get('version', '2')
188188
except Exception as e:
@@ -224,8 +224,8 @@ def format_messages(where, e, log):
224224
file_name['xml'] = os.path.join(settings.IDSUBMIT_STAGING_PATH, '%s-%s.%s' % (self.filename, self.revision, ext))
225225
try:
226226
if xml_version == '3':
227-
prep = xml2rfc.PrepToolWriter(self.xmltree, quiet=True, liberal=True)
228-
prep.options.accept_prepped = True
227+
prep = xml2rfc.PrepToolWriter(self.xmltree, quiet=True, liberal=True, keep_pis=[xml2rfc.V3_PI_TARGET])
228+
prep.options.accept_prepped = True
229229
self.xmltree.tree = prep.prep()
230230
if self.xmltree.tree == None:
231231
raise forms.ValidationError("Error from xml2rfc (prep): %s" % prep.errors)

0 commit comments

Comments
 (0)