{"action":"created","issue":{"url":"https://api.github.com/repos/marianoguerra/rst2html5/issues/64","labels_url":"https://api.github.com/repos/marianoguerra/rst2html5/issues/64/labels{/name}","comments_url":"https://api.github.com/repos/marianoguerra/rst2html5/issues/64/comments","events_url":"https://api.github.com/repos/marianoguerra/rst2html5/issues/64/events","html_url":"https://github.com/marianoguerra/rst2html5/issues/64","id":45890385,"number":64,"title":"Error when attempting to align an image to the right","user":{"login":"HalosGhost","id":49465,"avatar_url":"https://avatars.githubusercontent.com/u/49465?v=3","gravatar_id":"","url":"https://api.github.com/users/HalosGhost","html_url":"https://github.com/HalosGhost","followers_url":"https://api.github.com/users/HalosGhost/followers","following_url":"https://api.github.com/users/HalosGhost/following{/other_user}","gists_url":"https://api.github.com/users/HalosGhost/gists{/gist_id}","starred_url":"https://api.github.com/users/HalosGhost/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/HalosGhost/subscriptions","organizations_url":"https://api.github.com/users/HalosGhost/orgs","repos_url":"https://api.github.com/users/HalosGhost/repos","events_url":"https://api.github.com/users/HalosGhost/events{/privacy}","received_events_url":"https://api.github.com/users/HalosGhost/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":5,"created_at":"2014-10-15T16:40:01Z","updated_at":"2015-06-08T00:23:13Z","closed_at":null,"body":"I have the following snippet in my ``index.rst``:\r\n\r\n    .. |hackerlogo| image:: hackerlogo.png\r\n                    :alt: hacker-emblem\r\n                    :align: bottom\r\n                    :target: http://www.catb.org/hacker-emblem/\r\n\r\nThis works just fine; however, if I change ``bottom`` to ``right`` (a valid value according to [the docutils documentation](http://docutils.sourceforge.net/docs/ref/rst/directives.html#image)), I get the following error when running ``rst2html5``:\r\n\r\n    index.rst:55: (ERROR/3) Error in \"image\" directive: \"right\" is not a valid value for the \"align\" option within a substitution definition.  Valid values for \"align\" are: \"top\", \"middle\", \"bottom\".\r\n    index.rst:55: (WARNING/2) Substitution definition \"hackerlogo\" empty or invalid.\r\n\r\n    .. |hackerlogo| image:: hackerlogo.png\r\n                    :alt: hacker-emblem\r\n                    :align: right\r\n                    :target: http://www.catb.org/hacker-emblem/\r\n    index.rst:51: (ERROR/3) Undefined substitution referenced: \"hackerlogo\".\r\n\r\nAs a result, to get the desired affect, I'm going into the generated ``index.html`` and manually changeing ``class=\"align-bottom\"`` to ``class=\"align-right\"``. Ideally, ``rst2html5`` would recognize ``right`` as a valid value and set the ``class`` accordingly."},"comment":{"url":"https://api.github.com/repos/marianoguerra/rst2html5/issues/comments/109817197","html_url":"https://github.com/marianoguerra/rst2html5/issues/64#issuecomment-109817197","issue_url":"https://api.github.com/repos/marianoguerra/rst2html5/issues/64","id":109817197,"user":{"login":"asermax","id":1452164,"avatar_url":"https://avatars.githubusercontent.com/u/1452164?v=3","gravatar_id":"","url":"https://api.github.com/users/asermax","html_url":"https://github.com/asermax","followers_url":"https://api.github.com/users/asermax/followers","following_url":"https://api.github.com/users/asermax/following{/other_user}","gists_url":"https://api.github.com/users/asermax/gists{/gist_id}","starred_url":"https://api.github.com/users/asermax/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/asermax/subscriptions","organizations_url":"https://api.github.com/users/asermax/orgs","repos_url":"https://api.github.com/users/asermax/repos","events_url":"https://api.github.com/users/asermax/events{/privacy}","received_events_url":"https://api.github.com/users/asermax/received_events","type":"User","site_admin":false},"created_at":"2015-06-08T00:23:13Z","updated_at":"2015-06-08T00:23:13Z","body":"Ohh I missed your example being a definition for inline substitution (I'm still learning some aspects of RST). \r\n\r\nBased on [this mailing list thread](http://sourceforge.net/p/docutils/mailman/docutils-users/thread/5094D9A8.9060200@faunalia.it/), I think the behaviour you're experiencing is the expected one. The way you're defining your image is used for inline substitution, which means using the image within a line a text, in which case only the `top`, `bottom` and `middle` values make sense (which is what the error says).\r\n\r\nIf instead you remove the reference (`|hackerlogo|`) and use the image directive directly where the logo will be used, you will be able to use the `right` value for the `align` property (this is what I have tested and works correctly).\r\n\r\nIn any case, if you still think this is a bug, you should probably report it upstream, since that's how docutils is implemented."}}