{"action":"opened","issue":{"url":"https://api.github.com/repos/showdownjs/showdown/issues/264","repository_url":"https://api.github.com/repos/showdownjs/showdown","labels_url":"https://api.github.com/repos/showdownjs/showdown/issues/264/labels{/name}","comments_url":"https://api.github.com/repos/showdownjs/showdown/issues/264/comments","events_url":"https://api.github.com/repos/showdownjs/showdown/issues/264/events","html_url":"https://github.com/showdownjs/showdown/issues/264","id":159827813,"number":264,"title":"Multiple Extensions Concurrency","user":{"login":"Sleashe","id":3600361,"avatar_url":"https://avatars.githubusercontent.com/u/3600361?v=3","gravatar_id":"","url":"https://api.github.com/users/Sleashe","html_url":"https://github.com/Sleashe","followers_url":"https://api.github.com/users/Sleashe/followers","following_url":"https://api.github.com/users/Sleashe/following{/other_user}","gists_url":"https://api.github.com/users/Sleashe/gists{/gist_id}","starred_url":"https://api.github.com/users/Sleashe/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Sleashe/subscriptions","organizations_url":"https://api.github.com/users/Sleashe/orgs","repos_url":"https://api.github.com/users/Sleashe/repos","events_url":"https://api.github.com/users/Sleashe/events{/privacy}","received_events_url":"https://api.github.com/users/Sleashe/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2016-06-12T13:33:36Z","updated_at":"2016-06-12T13:33:36Z","closed_at":null,"body":"Hello Guys,\r\n\r\nWe discovered Showdown a few days ago and it's awesome. We decided to write our own extensions to add some nice features but we're experiencing a few problems, let me explain : \r\nWe created two extensions :\r\n- One for parsing a special block surrounded by `TIPS...   some-text  ...TIPS` which gives `<div class=\"tips-class\"><div class=\"tips-content\">some-text</div></div>`\r\n- One for converting `-sometext-` into `<span class=\"underlined\">sometext</span>`\r\n\r\nThese two extensions are named `tips` and `underlined` and are loaded like this:\r\n`new showdown.Converter({extensions: [\"tips\", \"underlined\"]});`\r\n\r\nWhen I write TIPS...sometext...TIPS in my editor, this first extension is executed and gives this output:\r\n```javascript\r\n<div class=\"tips-class\">\r\n    <div class=\"tips-content\">some-text</div>\r\n</div>\r\n``` \r\n\r\n**AND THEN, the second extension parses the previous output and it produces a wrong and broken output :**\r\n```javascript\r\n<div class=\"tips-<span class=\"underlined\">class\">\r\n    <div class=\"tips-</span>content\">some-text\r\n    </div>\r\n</div>\r\n```\r\n\r\n**However**, if  change this `new showdown.Converter({extensions: [\"tips\", \"underlined\"]});` into `new showdown.Converter({extensions: [\"underlined\", \"tips\"]});`, everything is working well. It seems that showdown extensions are trying to parse html too !\r\n\r\nDo you have any idea that could help us ?\r\n\r\nI put the extensions code below:\r\n```javascript\r\n{\r\n  type: 'lang',\r\n  filter: function (text, converter, options) {\r\n\r\n    text = text.replace(/(TIPS\\.{3})((.|\\n)*?)(\\.{3}TIPS)/gm, function (match, content, onlytext) {\r\n      return '\\n' + \"<div class=\\\"tips-class\\\"><div class=\\\"tips-content\\\">\" + onlytext + \"</div></div>\" + '\\n';\r\n    });\r\n    return text;\r\n  }\r\n```\r\n```javascript\r\n{\r\n    type: 'lang',\r\n    regex: /(\\-)(?=\\S)([^\\r]*?\\S)\\1/g,\r\n    replace: \"<span class=\\\"underline\\\">$2<\\/span>\"\r\n  }\r\n```\r\n\r\n"}}
{"actor":{"display_login":"Sleashe"}}