{"action":"created","issue":{"url":"https://api.github.com/repos/facebook/draft-js/issues/1729","repository_url":"https://api.github.com/repos/facebook/draft-js","labels_url":"https://api.github.com/repos/facebook/draft-js/issues/1729/labels{/name}","comments_url":"https://api.github.com/repos/facebook/draft-js/issues/1729/comments","events_url":"https://api.github.com/repos/facebook/draft-js/issues/1729/events","html_url":"https://github.com/facebook/draft-js/issues/1729","id":313237907,"node_id":"MDU6SXNzdWUzMTMyMzc5MDc=","number":1729,"title":"How to manipulate a span strategy to apply multiple styles?","user":{"login":"Shudrum","id":2795733,"node_id":"MDQ6VXNlcjI3OTU3MzM=","avatar_url":"https://avatars0.githubusercontent.com/u/2795733?v=4","gravatar_id":"","url":"https://api.github.com/users/Shudrum","html_url":"https://github.com/Shudrum","followers_url":"https://api.github.com/users/Shudrum/followers","following_url":"https://api.github.com/users/Shudrum/following{/other_user}","gists_url":"https://api.github.com/users/Shudrum/gists{/gist_id}","starred_url":"https://api.github.com/users/Shudrum/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Shudrum/subscriptions","organizations_url":"https://api.github.com/users/Shudrum/orgs","repos_url":"https://api.github.com/users/Shudrum/repos","events_url":"https://api.github.com/users/Shudrum/events{/privacy}","received_events_url":"https://api.github.com/users/Shudrum/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2018-04-11T09:14:33Z","updated_at":"2018-09-08T22:54:33Z","closed_at":"2018-09-08T22:54:33Z","author_association":"NONE","body":"Hello there!\r\n\r\nNot even a feature request or a bug. I have a **simple** question.\r\n\r\nDo you know Bear (the markdown note tool)? I would like to create an effect like this tool.\r\n\r\nI'll try to be clear:I would like to test a strategy for making a bold effect. If the user write \\*boldtext\\*, I would like the editor to display **\\*boldtext\\***, but I want the stars to be gray.\r\n\r\nSo I've added a simple test to the tweet example:\r\n\r\n```javascript\r\n// After added the strategy to the CompositeDecorator:\r\n\r\nconst BOLD_REGEX = /\\*([\\w]+)\\*/g;\r\n\r\nfunction boldStrategy(contentBlock, callback, contentState) {\r\n  findWithRegex(BOLD_REGEX, contentBlock, callback);\r\n}\r\n\r\nconst BoldSpan = (props, test) => {\r\n  const result = BOLD_REGEX.exec(props.decoratedText);\r\n  return (\r\n    <span\r\n      style={styles.bold}\r\n      data-offset-key={props.offsetKey}\r\n    >\r\n      <span style={styles.light}>*</span>\r\n      {result[1]}\r\n      <span style={styles.light}>*</span>\r\n    </span>\r\n  );\r\n};\r\n\r\n// Then added the styles\r\n```\r\n\r\nStupid test that does not work because the result is a simple string instead of the complex processed children from the props.\r\n\r\n\r\nIs there a way to do this?\r\n\r\nThank you!\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/facebook/draft-js/issues/comments/419678149","html_url":"https://github.com/facebook/draft-js/issues/1729#issuecomment-419678149","issue_url":"https://api.github.com/repos/facebook/draft-js/issues/1729","id":419678149,"node_id":"MDEyOklzc3VlQ29tbWVudDQxOTY3ODE0OQ==","user":{"login":"niveditc","id":2357761,"node_id":"MDQ6VXNlcjIzNTc3NjE=","avatar_url":"https://avatars0.githubusercontent.com/u/2357761?v=4","gravatar_id":"","url":"https://api.github.com/users/niveditc","html_url":"https://github.com/niveditc","followers_url":"https://api.github.com/users/niveditc/followers","following_url":"https://api.github.com/users/niveditc/following{/other_user}","gists_url":"https://api.github.com/users/niveditc/gists{/gist_id}","starred_url":"https://api.github.com/users/niveditc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/niveditc/subscriptions","organizations_url":"https://api.github.com/users/niveditc/orgs","repos_url":"https://api.github.com/users/niveditc/repos","events_url":"https://api.github.com/users/niveditc/events{/privacy}","received_events_url":"https://api.github.com/users/niveditc/received_events","type":"User","site_admin":false},"created_at":"2018-09-08T22:54:33Z","updated_at":"2018-09-08T22:54:33Z","author_association":"CONTRIBUTOR","body":"Looks like this question is answered. Please reopen if you have further queries :) "}}
{"actor":{"display_login":"niveditc"}}