Moodle

Help should be well-formed, XHTML Strict and semantic

Details

Description

Following on from bug MDL-7861 "Strict XHTML 1.0", I am building up a patch to fix stray ampersands, poor semantics, etc. in help HTML files (lang/en_utf8/help/*). This is what I'm tackling:

1 Well-formed XML

  • Stray ampersands, regular expression /&[^a^l^g^q^n^#]/ (Not perfect, but a start). Specific searches &file, &bug, &mod.

2 Semantics

  • Each */index.html should start with a <h2> </h2>, except help/index.html which should start <h1> </h1>
  • Other headings, regular expression /<p><b>(.*?)</b></p>/, should be replaced variously with <h2>$1</h2>, <h3>$1</h3> as appropriate - a headache!

NOTES,

  • I want to be pragmatic. - should we aim for Strict DTD for help? Would Transitional be sufficient?
  • I'm ONLY fixing English language, en_utf8 - how can we systematically fix other languages.

Issue Links

Activity

Hide
Nick Freear added a comment -

As well as help files, I fixed some stray ampersands in string files, en_utf8/enrol_authorize.php, en_utf8/moodle.php

I'm attaching version 2 of the patch (v1 was 4 April) - anyone want to review? There are still "Other headings" to fix (x100!), but I may just commit what I've done.

Show
Nick Freear added a comment - As well as help files, I fixed some stray ampersands in string files, en_utf8/enrol_authorize.php, en_utf8/moodle.php I'm attaching version 2 of the patch (v1 was 4 April) - anyone want to review? There are still "Other headings" to fix (x100!), but I may just commit what I've done.
Hide
Nick Freear added a comment -

Added URLs.

Show
Nick Freear added a comment - Added URLs.
Hide
Nicolas Martignoni added a comment -

Nick, could you post here your grep's or your script, as I would like to fix the french language.

Thanks in advance.

Show
Nicolas Martignoni added a comment - Nick, could you post here your grep's or your script, as I would like to fix the french language. Thanks in advance.
Hide
Nick Freear added a comment -

I committed 2 patches: 'v31' and 'partb' (both attached) to HEAD and 1.8 branch. Patch 'partb' re-applies fixes by Nicolas Connault in help/install.html - sorry! The patch affects 70 files, most in lang/en_utf8/help/ directory EXCEPT:
-help.php
-theme/standard/styles_color.css
-lang/en_utf8/moodle.php
-lang/en_utf8/enrol_authorize.php


Hi Nicolas Martigoni
Thanks for your enquiry - I used the search and replace in Eclipse. These are the patterns with notes - hope they help! Nick

-lang/en_utf8/help/*/index.html
<p>(.*?)</p> – <h2>$1</h2> --1st line only.

-lang/en_utf8/.
&[^a^l^g^q^n^#] – &

&([file|mod|bug]) – &$1 --Untested!

<hr size.*?/> – <hr /> --See theme/standard/styles_color.css

<td align="right"><p><b>(.*?)</b></p></td> – <th align="right" scope="col">$1</th> --TODO: remove align right.

<p><b>(.*?)</b></p> – <h2>$1</h2> --Careful, with exceptions!

target=".*?" – '' --Empty string, not used yet!

Show
Nick Freear added a comment - I committed 2 patches: 'v31' and 'partb' (both attached) to HEAD and 1.8 branch. Patch 'partb' re-applies fixes by Nicolas Connault in help/install.html - sorry! The patch affects 70 files, most in lang/en_utf8/help/ directory EXCEPT: -help.php -theme/standard/styles_color.css -lang/en_utf8/moodle.php -lang/en_utf8/enrol_authorize.php – Hi Nicolas Martigoni Thanks for your enquiry - I used the search and replace in Eclipse. These are the patterns with notes - hope they help! Nick -lang/en_utf8/help/*/index.html <p>(.*?)</p> – <h2>$1</h2> --1st line only. -lang/en_utf8/. &[^a^l^g^q^n^#] – & &([file|mod|bug]) – &$1 --Untested! <hr size.*?/> – <hr /> --See theme/standard/styles_color.css <td align="right"><p><b>(.*?)</b></p></td> – <th align="right" scope="col">$1</th> --TODO: remove align right. <p><b>(.*?)</b></p> – <h2>$1</h2> --Careful, with exceptions! target=".*?" – '' --Empty string, not used yet!
Hide
Nicolas Martignoni added a comment -

Thanks Nick !

Done for french language (fr_utf8) ! have to commit it now, but can't access the CVS

Show
Nicolas Martignoni added a comment - Thanks Nick ! Done for french language (fr_utf8) ! have to commit it now, but can't access the CVS
Hide
Nicolas Martignoni added a comment -

fr_utf8 committed.

Show
Nicolas Martignoni added a comment - fr_utf8 committed.
Hide
Nick Freear added a comment -

After a long delay I'm completing the fix for this bug. The attached "Part C version 2.2" patch:

  • replaces misused <blockquote> (including nested in install.html) and <ul> WITH <div class="indent">,
  • replaces <p align="right"> WITH <p class="moreinfo">,
  • adds child <p> to correctly used <blockquote>, eg. in /lang/en_utf8/help/lesson/import.html,
  • fixes lists incorrectly nested in paragraphs, eg. <p>text\n <ul> ...</ul> </p> TO <p>text</p>\n <ul> ... </ul>
  • fixes a few other validation/semantic errors.
  • the patch is committed on HEAD (before the 1.9 branch) and 1.8 branches,
  • styles are now in /theme/standard/styles_layout.css (including some colour, but it's not worthwhile to split them),
  • "completing" because of the 'law of diminishing returns',
  • again only committed for 'en_utf8' language - any help with other languages appreciated!

Yours, Nick

Show
Nick Freear added a comment - After a long delay I'm completing the fix for this bug. The attached "Part C version 2.2" patch:
  • replaces misused <blockquote> (including nested in install.html) and <ul> WITH <div class="indent">,
  • replaces <p align="right"> WITH <p class="moreinfo">,
  • adds child <p> to correctly used <blockquote>, eg. in /lang/en_utf8/help/lesson/import.html,
  • fixes lists incorrectly nested in paragraphs, eg. <p>text\n <ul> ...</ul> </p> TO <p>text</p>\n <ul> ... </ul>
  • fixes a few other validation/semantic errors.
  • the patch is committed on HEAD (before the 1.9 branch) and 1.8 branches,
  • styles are now in /theme/standard/styles_layout.css (including some colour, but it's not worthwhile to split them),
  • "completing" because of the 'law of diminishing returns',
  • again only committed for 'en_utf8' language - any help with other languages appreciated!
Yours, Nick
Hide
Nicolas Martignoni added a comment -

fr_utf8 committed (again). Thanks for the hints given.

Show
Nicolas Martignoni added a comment - fr_utf8 committed (again). Thanks for the hints given.
Hide
Nick Freear added a comment -

Specific bug is fixed for English language pack for 1.9 - see MDL-12902 for the generic multi-language issue with help files.

Show
Nick Freear added a comment - Specific bug is fixed for English language pack for 1.9 - see MDL-12902 for the generic multi-language issue with help files.
Hide
Nicolas Martignoni added a comment -

Closing, as verified for en_utf8 pack. Thanks.

Show
Nicolas Martignoni added a comment - Closing, as verified for en_utf8 pack. Thanks.

People

Vote (0)
Watch (1)

Dates

  • Created:
    Updated:
    Resolved: