{"action":"created","issue":{"url":"https://api.github.com/repos/Python-Markdown/markdown/issues/671","repository_url":"https://api.github.com/repos/Python-Markdown/markdown","labels_url":"https://api.github.com/repos/Python-Markdown/markdown/issues/671/labels{/name}","comments_url":"https://api.github.com/repos/Python-Markdown/markdown/issues/671/comments","events_url":"https://api.github.com/repos/Python-Markdown/markdown/issues/671/events","html_url":"https://github.com/Python-Markdown/markdown/issues/671","id":333567902,"node_id":"MDU6SXNzdWUzMzM1Njc5MDI=","number":671,"title":"Meta extension does not reset attribute","user":{"login":"Glandos","id":297578,"node_id":"MDQ6VXNlcjI5NzU3OA==","avatar_url":"https://avatars2.githubusercontent.com/u/297578?v=4","gravatar_id":"","url":"https://api.github.com/users/Glandos","html_url":"https://github.com/Glandos","followers_url":"https://api.github.com/users/Glandos/followers","following_url":"https://api.github.com/users/Glandos/following{/other_user}","gists_url":"https://api.github.com/users/Glandos/gists{/gist_id}","starred_url":"https://api.github.com/users/Glandos/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Glandos/subscriptions","organizations_url":"https://api.github.com/users/Glandos/orgs","repos_url":"https://api.github.com/users/Glandos/repos","events_url":"https://api.github.com/users/Glandos/events{/privacy}","received_events_url":"https://api.github.com/users/Glandos/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-06-19T08:25:59Z","updated_at":"2018-06-19T12:57:18Z","closed_at":null,"author_association":"NONE","body":"Hi,\r\nHere is a test case:\r\n\r\n```ipython\r\nIn [1]: from markdown import Markdown\r\n\r\nIn [2]: md = Markdown(extensions=['markdown.extensions.meta'])\r\n\r\nIn [3]: md.convert('''Title:   My Document\r\n   ...: Summary: A brief description of my document.\r\n   ...: Authors: Waylan Limberg\r\n   ...:          John Doe\r\n   ...: Date:    October 2, 2007\r\n   ...: blank-value:\r\n   ...: base_url: http://example.com\r\n   ...: \r\n   ...: This is the first paragraph of the document.''')\r\nOut[3]: '<p>This is the first paragraph of the document.</p>'\r\n\r\nIn [4]: md.Meta\r\nOut[4]: \r\n{'title': ['My Document'],\r\n 'summary': ['A brief description of my document.'],\r\n 'authors': ['Waylan Limberg', 'John Doe'],\r\n 'date': ['October 2, 2007'],\r\n 'blank-value': [''],\r\n 'base_url': ['http://example.com']}\r\n\r\nIn [5]: md.reset()\r\nOut[5]: <markdown.Markdown at 0x7fc5a9b784e0>\r\n\r\nIn [6]: md.convert('''Title: Small doc\r\n   ...: \r\n   ...: Content''')\r\nOut[6]: '<p>Content</p>'\r\n\r\nIn [7]: md.Meta\r\nOut[7]: {'title': ['Small doc']}\r\n\r\nIn [8]: md.reset()\r\nOut[8]: <markdown.Markdown at 0x7fc5a9b784e0>\r\n\r\nIn [9]: md.convert('')\r\nOut[9]: ''\r\n\r\nIn [10]: md.Meta\r\nOut[10]: {'title': ['Small doc']}\r\n\r\n```\r\n\r\nA call to `reset()` does not remove the `Meta` attribute from the `Markdown` class. And since a call to `convert()` with an empty string does not call preprocessors (maybe it should?), the `Meta` attributes has invalid data."},"comment":{"url":"https://api.github.com/repos/Python-Markdown/markdown/issues/comments/398389203","html_url":"https://github.com/Python-Markdown/markdown/issues/671#issuecomment-398389203","issue_url":"https://api.github.com/repos/Python-Markdown/markdown/issues/671","id":398389203,"node_id":"MDEyOklzc3VlQ29tbWVudDM5ODM4OTIwMw==","user":{"login":"waylan","id":78846,"node_id":"MDQ6VXNlcjc4ODQ2","avatar_url":"https://avatars3.githubusercontent.com/u/78846?v=4","gravatar_id":"","url":"https://api.github.com/users/waylan","html_url":"https://github.com/waylan","followers_url":"https://api.github.com/users/waylan/followers","following_url":"https://api.github.com/users/waylan/following{/other_user}","gists_url":"https://api.github.com/users/waylan/gists{/gist_id}","starred_url":"https://api.github.com/users/waylan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/waylan/subscriptions","organizations_url":"https://api.github.com/users/waylan/orgs","repos_url":"https://api.github.com/users/waylan/repos","events_url":"https://api.github.com/users/waylan/events{/privacy}","received_events_url":"https://api.github.com/users/waylan/received_events","type":"User","site_admin":false},"created_at":"2018-06-19T12:57:18Z","updated_at":"2018-06-19T12:57:18Z","author_association":"MEMBER","body":"Interesting edge case. I specifically recall looking at this before and determining that each call to `convert` would overwrite the meta data. Apparently I hadn't considered the case of an empty document. When `convert` detects an empty document, it immediately returns and does not run anything. Of course, that means it doesn't overwrite the meta data either."}}
{"actor":{"display_login":"waylan"}}