{"id":55306,"date":"2022-04-04T03:01:04","date_gmt":"2022-04-03T17:01:04","guid":{"rendered":"http:\/\/www.rjmprogramming.com.au\/ITblog\/?p=55306"},"modified":"2022-04-11T19:39:02","modified_gmt":"2022-04-11T09:39:02","slug":"html-carriage-return-and-or-line-feed-primer-tutorial","status":"publish","type":"post","link":"https:\/\/www.rjmprogramming.com.au\/ITblog\/html-carriage-return-and-or-line-feed-primer-tutorial\/","title":{"rendered":"HTML Carriage Return and or Line Feed Primer Tutorial"},"content":{"rendered":"<div style=\"width: 230px\" class=\"wp-caption alignnone\"><a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/PHP\/cr_andor_lf.php\"><img decoding=\"async\" style=\"border: 15px solid pink;\" alt=\"HTML Carriage Return and or Line Feed Primer Tutorial\" src=\"http:\/\/www.rjmprogramming.com.au\/PHP\/cr_andor_lf.jpg\" title=\"HTML Carriage Return and or Line Feed Primer Tutorial\"  style=\"float:left;\" \/><\/a><p class=\"wp-caption-text\">HTML Carriage Return and or Line Feed Primer Tutorial<\/p><\/div>\n<p>Some vertical record delimiting wonderment in HTML we just let pass through to the keeper, except to say that HTML rendering just about always works as intended, and yet <i>back in the day<\/i> you&#8217;d need to worry about whether your desktop C program, for instance, was written using (an underlying) Windows or Linux or Mac OS X (operating system).  And then we stumbled upon <a target=_blank title=\\\"HTML when it normalizes newlines will convert all \\\\r\\\\n sequences to \\\\n and then all remaining \\\\r to \\\\n, so effectively getting rid of all lonely \\\\r characters. However, Node.textContent doesn't call this normalize-newlines algorithm, so they're not converted to \\\\n and not interpreted as segment-break.\\\" href='https:\/\/stackoverflow.com\/questions\/57965834\/why-carriage-return-not-rendered-as-a-line-break-when-assigned-to-textcontent-al'>javascript &#8211; Why carriage return not rendered as a line break when assigned to textContent although formatted using pre? &#8211; Stack Overflow<\/a>&#8216;s &#8230;<\/p>\n<blockquote cite='https:\/\/stackoverflow.com\/questions\/57965834\/why-carriage-return-not-rendered-as-a-line-break-when-assigned-to-textcontent-al'><p>\nHTML when it normalizes newlines will convert all \\r\\n sequences to \\n and then all remaining \\r to \\n, so effectively getting rid of all lonely \\r characters. However, Node.textContent doesn&#8217;t call this normalize-newlines algorithm, so they&#8217;re not converted to \\n and not interpreted as segment-break.\n<\/p><\/blockquote>\n<p> &#8230; which seemed to explain the process of <i>vertical record delimiting HTML rendering rules<\/i> so well.  This resulted in us trying to prove this, and caused us to write a proof of concept <a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/PHP\/cr_andor_lf.php_GETME\" title=\"cr_andor_lf.php\">cr_andor_lf.php<\/a> <a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/PHP\/cr_andor_lf.php\">web application<\/a> that you can also try for yourself below &#8230;<\/p>\n<p><iframe src=\"http:\/\/www.rjmprogramming.com.au\/PHP\/cr_andor_lf.php\" style=\"width:100%;height:900px;\"><\/iframe><\/p>\n<p> &#8230; and we hope this is of some interest to you as well.<\/p>\n<p>If this was interesting you may be interested in <a title='Click here to see topics in which you might be interested' href='#d55306' onclick='var dv=document.getElementById(\"d55306\"); dv.innerHTML = \"&lt;iframe width=670 height=600 src=\" + \"https:\/\/www.rjmprogramming.com.au\/ITblog\/tag\/carriage-return\" + \"&gt;&lt;\/iframe&gt;\"; dv.style.display = \"block\";'>this<\/a> too.<\/p>\n<div id='d55306' style='display: none; border-left: 2px solid green; border-top: 2px solid green;'><\/div>\n","protected":false},"excerpt":{"rendered":"<p>Some vertical record delimiting wonderment in HTML we just let pass through to the keeper, except to say that HTML rendering just about always works as intended, and yet back in the day you&#8217;d need to worry about whether your &hellip; <a href=\"https:\/\/www.rjmprogramming.com.au\/ITblog\/html-carriage-return-and-or-line-feed-primer-tutorial\/\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[12,37],"tags":[2698,2276,452,576,2533,997,1986,2407,1049,3625,1262,1319,3035,1425],"class_list":["post-55306","post","type-post","status-publish","format-standard","hentry","category-elearning","category-tutorials","tag-carriage-return","tag-delimitation","tag-form","tag-html","tag-line-feed","tag-programming","tag-proof-of-concept","tag-record","tag-render","tag-rendering","tag-textarea","tag-tutorial","tag-vertical","tag-whitespace"],"_links":{"self":[{"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/posts\/55306"}],"collection":[{"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/comments?post=55306"}],"version-history":[{"count":8,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/posts\/55306\/revisions"}],"predecessor-version":[{"id":55379,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/posts\/55306\/revisions\/55379"}],"wp:attachment":[{"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/media?parent=55306"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/categories?post=55306"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/tags?post=55306"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}