|
From: <mi...@us...> - 2022-05-06 10:30:18
|
Revision: 9056
http://sourceforge.net/p/docutils/code/9056
Author: milde
Date: 2022-05-06 10:29:55 +0000 (Fri, 06 May 2022)
Log Message:
-----------
Remove class value "controls" from an `image` node with video content
after converting it to a "control" attribute of the `<video>` tag.
Thanks to Agathe Porte for the hint.
TODO: discuss other special `<video>` attributes.
https://developer.mozilla.org/en-US/docs/Web/HTML/Element/video
Modified Paths:
--------------
trunk/docutils/HISTORY.txt
trunk/docutils/docutils/writers/html5_polyglot/__init__.py
trunk/docutils/test/functional/expected/misc_rst_html5.html
Modified: trunk/docutils/HISTORY.txt
===================================================================
--- trunk/docutils/HISTORY.txt 2022-04-29 16:24:29 UTC (rev 9055)
+++ trunk/docutils/HISTORY.txt 2022-05-06 10:29:55 UTC (rev 9056)
@@ -86,6 +86,8 @@
* docutils/writers/html5_polyglot/__init__.py
- Add space before "charset" meta tag closing sequence.
+ - Remove class value "controls" from an `image` node with video content
+ after converting it to a "control" attribute of the <video> tag.
* docutils/writers/pep_html/
Modified: trunk/docutils/docutils/writers/html5_polyglot/__init__.py
===================================================================
--- trunk/docutils/docutils/writers/html5_polyglot/__init__.py 2022-04-29 16:24:29 UTC (rev 9055)
+++ trunk/docutils/docutils/writers/html5_polyglot/__init__.py 2022-05-06 10:29:55 UTC (rev 9056)
@@ -284,6 +284,7 @@
atts['class'] = 'align-%s' % node['align']
if 'controls' in node['classes']:
atts['controls'] = 'controls'
+ node['classes'].remove('controls')
atts['title'] = node.get('alt', uri)
if getattr(self.settings, 'image_loading', None) == 'lazy':
atts['loading'] = 'lazy'
Modified: trunk/docutils/test/functional/expected/misc_rst_html5.html
===================================================================
--- trunk/docutils/test/functional/expected/misc_rst_html5.html 2022-04-29 16:24:29 UTC (rev 9055)
+++ trunk/docutils/test/functional/expected/misc_rst_html5.html 2022-05-06 10:29:55 UTC (rev 9056)
@@ -134,7 +134,7 @@
loads. According to the <a class="reference external" href="https://developer.mozilla.org/en-US/docs/Web/HTML/Element/video">HTML5 spec</a>, hight and width must be
specified as pixel values.</p>
<figure class="align-center">
-<video class="controls" controls="controls" src="../../../docs/user/rst/images/pens.mp4" title="test video in a figure" width="200">
+<video controls="controls" src="../../../docs/user/rst/images/pens.mp4" title="test video in a figure" width="200">
<a href="../../../docs/user/rst/images/pens.mp4">test video in a figure</a>
</video>
<figcaption>
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|