{"action":"closed","issue":{"url":"https://api.github.com/repos/MrRio/jsPDF/issues/1786","repository_url":"https://api.github.com/repos/MrRio/jsPDF","labels_url":"https://api.github.com/repos/MrRio/jsPDF/issues/1786/labels{/name}","comments_url":"https://api.github.com/repos/MrRio/jsPDF/issues/1786/comments","events_url":"https://api.github.com/repos/MrRio/jsPDF/issues/1786/events","html_url":"https://github.com/MrRio/jsPDF/issues/1786","id":328501431,"node_id":"MDU6SXNzdWUzMjg1MDE0MzE=","number":1786,"title":"Exeption in 'Renderer.prototype.splitFragmentsIntoLines' on empty lines","user":{"login":"jacob418","id":10586184,"node_id":"MDQ6VXNlcjEwNTg2MTg0","avatar_url":"https://avatars1.githubusercontent.com/u/10586184?v=4","gravatar_id":"","url":"https://api.github.com/users/jacob418","html_url":"https://github.com/jacob418","followers_url":"https://api.github.com/users/jacob418/followers","following_url":"https://api.github.com/users/jacob418/following{/other_user}","gists_url":"https://api.github.com/users/jacob418/gists{/gist_id}","starred_url":"https://api.github.com/users/jacob418/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jacob418/subscriptions","organizations_url":"https://api.github.com/users/jacob418/orgs","repos_url":"https://api.github.com/users/jacob418/repos","events_url":"https://api.github.com/users/jacob418/events{/privacy}","received_events_url":"https://api.github.com/users/jacob418/received_events","type":"User","site_admin":false},"labels":[{"id":839629695,"node_id":"MDU6TGFiZWw4Mzk2Mjk2OTU=","url":"https://api.github.com/repos/MrRio/jsPDF/labels/from_html.js","name":"from_html.js","color":"000000","default":false}],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2018-06-01T12:29:21Z","updated_at":"2018-09-06T20:16:14Z","closed_at":"2018-09-06T20:16:12Z","author_association":"NONE","body":"jsPDF Version: 1.4.0\r\n\r\nFound the problem in [jspdf.debug.js:8716](https://github.com/MrRio/jsPDF/blob/7a1089a7f2922cf2869ecd2a08be67e5a2082694/dist/jspdf.debug.js#L8716)\r\n\r\n**Steps to reproduce**\r\n\r\n* Create `<div>` Section with some text and double linebreakes (`<br><br>` )\r\n* feed reference to `<div>` as source to 'fromHTML' like shown below\r\n``` javascript\r\nvar pdf = new jsPDF({\r\n\torientation: 'p',\r\n\tunit: 'mm',\r\n\tformat: 'a4',\r\n});\r\n\r\n\tvar specialElementHandlers = {} ;\r\n\tvar margins = { top: 30, left: 30, right: 30, bottom: 30 };\r\n\tmargins.width = 210 - (margins.right + margins.left) ;\r\n\r\n\tvar source = this.$refs.document ; // this is referring a Vue instance \r\n\r\n\tif(typeof cb !== \"function\"){\r\n\t\tcb = function () {\r\n\t\t\tpdf.save('docname.pdf');\r\n\t\t}\r\n\t}\r\n\r\n\tpdf.fromHTML(\r\n\t\tsource,\r\n\t\tmargins.left,\r\n\t\tmargins.top,\r\n\t\t{'width': margins.width, 'elementHandlers': specialElementHandlers},\r\n\t\tcb) ;\r\n```\r\n* Get Error: `Uncaught TypeError: Cannot read property '0' of undefined`\r\n\t* `lines` in [jspdf.debug.js:8716](https://github.com/MrRio/jsPDF/blob/7a1089a7f2922cf2869ecd2a08be67e5a2082694/dist/jspdf.debug.js#L8716) will contain an empty sub-array for the line where the double `<br><br>` is placed\r\n\r\n**What I saw**: \r\n\r\n*JS-Exeption*\r\n\r\n```\r\nUncaught TypeError: Cannot read property '0' of undefined\r\n    at Renderer.splitFragmentsIntoLines (VM457 documentBuilder.js:8716)\r\n    at Renderer.renderParagraph (VM457 documentBuilder.js:8839)\r\n    at Renderer.setBlockBoundary (VM457 documentBuilder.js:8930)\r\n    at DrillForContent (VM457 documentBuilder.js:8482)\r\n    at DrillForContent (VM457 documentBuilder.js:8450)\r\n    at VM457 documentBuilder.js:8618\r\n    at done (VM457 documentBuilder.js:8493)\r\n    at loadImgs (VM457 documentBuilder.js:8522)\r\n    at process (VM457 documentBuilder.js:8616)\r\n    at Object.jsPDFAPI.fromHTML (VM457 documentBuilder.js:9014)\r\n```\r\n\r\n**What I expected**: a PDF file\r\n\r\n\r\n*NOTE: placing a `&nbsp;` between the `<br><br>` fixed the problem for me.*"}}
{"actor":{"display_login":"arasabbasi"}}