HTML tags inside template toolkit directives are not allowed because of translation issues. Instead of having many workaround in tt files it would be nice to have a filter that handles HTML tags.
Created attachment 63697 [details] [review] Bug 18665 - Translatability: Add tt filter to allow html tags inside tt directives HTML tags inside template toolkit directives are not allowed because of translation issues. Add a filter that handles HTML tags. To test: - Apply patch - Add [% USE HtmlTags %] to the top of a tt file - Add something like [% My nice title | $HtmlTags tag="h1" %] to the tt file - Verify that in output 'My nice title' has h1 tags - Change template directive to something like [% My nice title | $HtmlTags tag="h1" attributes='title="This is a nice title attribute"' %] - Verify that title attribute displays in output (source code or tooltip on 'My nice title') Notes: - Tests are planned for a second patch - Update for Wiki coding guidelines
Setting to NSO to get comments.
Created attachment 63721 [details] [review] Bug 18665: Add test for HtmlTags.pm This patch adds tests for the tt filter HtmlTags.pm To test: prove -v t/HtmlTags.t should pass
Created attachment 63754 [details] [review] Bug 15465: Fix typo in bugs.k-c.org
Comment on attachment 63754 [details] [review] Bug 15465: Fix typo in bugs.k-c.org Hmm, mistaked...
Created attachment 63765 [details] [review] Bug 18665 - Translatability: Add tt filter to allow html tags inside tt directives HTML tags inside template toolkit directives are not allowed because of translation issues. Add a filter that handles HTML tags. Note you need to write quotes ' around the text you want displayed as a heading To test: - Apply patch - Add [% USE HtmlTags %] to the top of a tt file - Add something like [% 'My nice title' | $HtmlTags tag="h1" %] to the tt file - Verify that in output 'My nice title' has h1 tags - Change template directive to something like [% 'My nice title' | $HtmlTags tag="h1" attributes='title="This is a nice title attribute"' %] - Verify that title attribute displays in output (source code or tooltip on 'My nice title') Notes: - Tests are planned for a second patch - Update for Wiki coding guidelines Signed-off-by: Alex Buckley <alexbuckley@catalyst.net.nz>
Created attachment 63766 [details] [review] Bug 18665: Add test for HtmlTags.pm This patch adds tests for the tt filter HtmlTags.pm To test: prove -v t/HtmlTags.t should pass Signed-off-by: Alex Buckley <alexbuckley@catalyst.net.nz>
Hi Marc I tested and found that the patches work nicely and all tests pass but your test plan is missing that you need to write quote marks ' around the text My nice title in order for it to be displayed correctly with this patch applied.
(In reply to Alex Buckley from comment #8) > Hi Marc > > I tested and found that the patches work nicely and all tests pass but your > test plan is missing that you need to write quote marks ' around the text My > nice title in order for it to be displayed correctly with this patch applied. Thanks for testing, Alex, and thanks for fixing my test plan! Marc
Created attachment 64415 [details] [review] Bug 18665 - Translatability: Add tt filter to allow html tags inside tt directives HTML tags inside template toolkit directives are not allowed because of translation issues. Add a filter that handles HTML tags. Note you need to write quotes ' around the text you want displayed as a heading To test: - Apply patch - Add [% USE HtmlTags %] to the top of a tt file - Add something like [% 'My nice title' | $HtmlTags tag="h1" %] to the tt file - Verify that in output 'My nice title' has h1 tags - Change template directive to something like [% 'My nice title' | $HtmlTags tag="h1" attributes='title="This is a nice title attribute"' %] - Verify that title attribute displays in output (source code or tooltip on 'My nice title') Notes: - Tests are planned for a second patch - Update for Wiki coding guidelines Signed-off-by: Alex Buckley <alexbuckley@catalyst.net.nz> Signed-off-by: Brendan A Gallagher <brendan@bywatersolutions.com>
Created attachment 64416 [details] [review] Bug 18665: Add test for HtmlTags.pm This patch adds tests for the tt filter HtmlTags.pm To test: prove -v t/HtmlTags.t should pass Signed-off-by: Alex Buckley <alexbuckley@catalyst.net.nz> Signed-off-by: Brendan A Gallagher <brendan@bywatersolutions.com>
Pushed to master for 17.11, thanks to everybody involved!
Enhancement not pushed to 17.05.x