{"action":"created","issue":{"url":"https://api.github.com/repos/sphinx-doc/testing2/issues/1488","labels_url":"https://api.github.com/repos/sphinx-doc/testing2/issues/1488/labels{/name}","comments_url":"https://api.github.com/repos/sphinx-doc/testing2/issues/1488/comments","events_url":"https://api.github.com/repos/sphinx-doc/testing2/issues/1488/events","html_url":"https://github.com/sphinx-doc/testing2/issues/1488","id":53299963,"number":1488,"title":"Only Directive does not order text as expected","user":{"login":"shimizukawa","id":151623,"avatar_url":"https://avatars.githubusercontent.com/u/151623?v=3","gravatar_id":"","url":"https://api.github.com/users/shimizukawa","html_url":"https://github.com/shimizukawa","followers_url":"https://api.github.com/users/shimizukawa/followers","following_url":"https://api.github.com/users/shimizukawa/following{/other_user}","gists_url":"https://api.github.com/users/shimizukawa/gists{/gist_id}","starred_url":"https://api.github.com/users/shimizukawa/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/shimizukawa/subscriptions","organizations_url":"https://api.github.com/users/shimizukawa/orgs","repos_url":"https://api.github.com/users/shimizukawa/repos","events_url":"https://api.github.com/users/shimizukawa/events{/privacy}","received_events_url":"https://api.github.com/users/shimizukawa/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/sphinx-doc/testing2/labels/blocked","name":"blocked","color":"FFFFFF"},{"url":"https://api.github.com/repos/sphinx-doc/testing2/labels/bug","name":"bug","color":"fc2929"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":9,"created_at":"2015-01-03T10:03:55Z","updated_at":"2015-01-03T10:05:04Z","closed_at":null,"body":"Learning reST to write user manuals.  (Hardware products.)  Devices can have one of three network connections so the format of one file is:\n'''\nStandard text\n.. only:: test1\n   text\n.. only:: test2\n   text\n.. only:: test1 or test2\n   text\n.. only test3\n   text\n'''\nIf the headings in the 'test1 or test2' section does not match the headings of 'test1' or 'test2' section, the  'test1 or test2' section appears before the 'test1' or 'test2' sections.\nAttached are two ZIP files of the resulting html files. The test1, test2, and test3 tags are defined in the associated conf.py files.\n\n\n----------------------------------------\n- Bitbucket: https://bitbucket.org/birkenfeld/sphinx/issue/1488\n- Originally reported by: David Nichols\n- Originally created at: 2014-06-11T22:13:07.729\n"},"comment":{"url":"https://api.github.com/repos/sphinx-doc/testing2/issues/comments/68589614","html_url":"https://github.com/sphinx-doc/testing2/issues/1488#issuecomment-68589614","issue_url":"https://api.github.com/repos/sphinx-doc/testing2/issues/1488","id":68589614,"user":{"login":"shimizukawa","id":151623,"avatar_url":"https://avatars.githubusercontent.com/u/151623?v=3","gravatar_id":"","url":"https://api.github.com/users/shimizukawa","html_url":"https://github.com/shimizukawa","followers_url":"https://api.github.com/users/shimizukawa/followers","following_url":"https://api.github.com/users/shimizukawa/following{/other_user}","gists_url":"https://api.github.com/users/shimizukawa/gists{/gist_id}","starred_url":"https://api.github.com/users/shimizukawa/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/shimizukawa/subscriptions","organizations_url":"https://api.github.com/users/shimizukawa/orgs","repos_url":"https://api.github.com/users/shimizukawa/repos","events_url":"https://api.github.com/users/shimizukawa/events{/privacy}","received_events_url":"https://api.github.com/users/shimizukawa/received_events","type":"User","site_admin":false},"created_at":"2015-01-03T10:05:03Z","updated_at":"2015-01-03T10:05:03Z","body":"_From Deniz Bahadir on 2014-11-07 11:28:49+00:00_\n\nI did not understand what the blog-entry is talking about. (Probably, the automated translation is not very accurate.)\n\nHowever, I think the following test-case is even simpler to demonstrate the problem:\n\n\n```\n#!reST\n\n###########################################\nSphinx - wrong heading location with 'only'\n###########################################\n\n\nSection 1\n=========\n\n.. only:: tag or not tag\n\n   Subsection 1.1\n   --------------\n\nThis sentence should be shown in **Subsection 1.1** and it is. \n\n\nSection 2\n=========\n\n.. only:: tag or not tag\n\n   Section 3\n   =========\n\nThis sentence should be shown in **Section 3** but it is not and instead shown in **Section 2**.\n\n```\n\nIs there really nothing which can be done to solve the problem? Then it sounds to me, as if Sphinx needs some kind of pre-processor (similar to the C/C++ pre-processor) which just removes inactive *only*-sections from the source-file before handing it over to sphinx-parser.\n"}}