@@ -387,6 +387,19 @@ def str2value(self, value):
387387 raise OptionValueError (self , value , self .class_description )
388388
389389
390+ class HtmlVersionOption (Option ):
391+ """Accept html4 only for now. Raise error for xhtml which is not
392+ supported in roundup 2.4 and newer."""
393+
394+ class_description = "Allowed values: html4"
395+
396+ def str2value (self , value ):
397+ _val = value .lower ()
398+ if _val in ("html4" ):
399+ return _val
400+ else :
401+ raise OptionValueError (self , value , self .class_description )
402+
390403class EmailBodyOption (Option ):
391404
392405 """When to replace message body or strip quoting: always, never
@@ -1083,14 +1096,10 @@ def str2value(self, value):
10831096 'or "both" (these are the three allowed values).\n '
10841097 'The dispatcher is configured using the DISPATCHER_EMAIL\n '
10851098 ' setting.' ),
1086- (Option , "html_version" , "html4" ,
1099+ (HtmlVersionOption , "html_version" , "html4" ,
10871100 "This setting should be left at the default value of html4.\n "
1088- "Support is ending for xhtml mode.\n "
1089- "HTML version to generate. The templates are html4 by default.\n "
1090- "If you wish to make them xhtml, then you'll need to change\n "
1091- "this setting to 'xhtml' too so all auto-generated HTML\n "
1092- "is compliant.\n "
1093- "Allowed values: html4, xhtml" ),
1101+ "Support for xhtml has been disabled.\n "
1102+ "HTML version to generate. The templates are html4 by default." ),
10941103 (TimezoneOption , "timezone" , TimezoneOption .defaulttz ,
10951104 "Default timezone offset,\n "
10961105 "applied when user's timezone is not set." ,
0 commit comments