{"id":206,"date":"2010-07-15T20:56:38","date_gmt":"2010-07-15T20:56:38","guid":{"rendered":"http:\/\/kryptech.name\/site\/?p=206"},"modified":"2010-07-15T20:56:38","modified_gmt":"2010-07-15T20:56:38","slug":"convert-openoffice-org-writer-rich-text-to-bb-code","status":"publish","type":"post","link":"https:\/\/kryptech.name\/site\/index.php\/convert-openoffice-org-writer-rich-text-to-bb-code\/","title":{"rendered":"Convert OpenOffice.org Writer Rich Text to BB Code"},"content":{"rendered":"<p>I&#8217;m part of a little writing group forum. It&#8217;s been a good experience to push myself to&nbsp;put down&nbsp;my ideas and also receive valuable feedback from other (more skilled) writers. I have so many ideas but I don&#8217;t like to start writing something unless I&#8217;m committeed to getting it done, so this group has been a good challenge for me.<\/p>\n<p>Anyway, I usually write in <a href=\"http:\/\/www.openoffice.org\/\" target=\"_new\">OpenOffice.org<\/a> Writer and then share my piece as a PDF. But this session we&#8217;re sharing on a forum. So if I copied and pasted my <em>italics<\/em> and any other formatting are lost. I looked for a Firefox add-on or <a href=\"https:\/\/addons.mozilla.org\/en-US\/firefox\/addon\/748\/\" target=\"_new\">Greasemonkey<\/a> script to convert rich text to forum BB code but no dice. Sure, one could just write the [i] [\/i] tags around italic text but that wouldn&#8217;t require any slick conversion and thus wouldn&#8217;t garner any style points.<\/p>\n<p>Just now I discovered a way to use Writer&#8217;s <em>Find &amp; Replace <\/em>dialog with <a href=\"http:\/\/wiki.services.openoffice.org\/wiki\/Documentation\/How_Tos\/Regular_Expressions_in_Writer\" target=\"_new\">regular expressions<\/a> to grab all italic text and wrap it in the BB tags. Like so:<\/p>\n<ul>\n<li>In the <em>Find &amp; Replace<\/em> dialog, click <em>More Options<\/em> and check <em>Regular expressions<\/em>. <\/li>\n<li>Click <em>Format<\/em>, and select &#8216;Italic&#8217; typeface under the <em>Font<\/em> tab. Click <em>OK<\/em>. <\/li>\n<li>In <em>Search for<\/em> enter <font style=\"BACKGROUND-COLOR: #ccffff\" face=\"Courier New, Courier, mono\">.+<\/font> (find one or more characters). <\/li>\n<li>In <em>Replace with<\/em> enter <font style=\"BACKGROUND-COLOR: #ccffff\" face=\"Courier New, Courier, mono\">[i]$0[\/i]<\/font> (wrap found string in tags). <\/li>\n<li>Click <em>Replace All<\/em> to make the changes. Note that the <em>italicized<\/em> text will still be in <em>italics<\/em>.<\/li>\n<\/ul>\n<p>Sweet! RegExp ftw!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I&#8217;m part of a little writing group forum. It&#8217;s been a good experience to push myself to&nbsp;put down&nbsp;my ideas and also receive valuable feedback from other (more skilled) writers. I have so many ideas but I don&#8217;t like to start writing something unless I&#8217;m committeed to getting it done, so this group has been a &#8230;<a class=\"post-readmore\" href=\"https:\/\/kryptech.name\/site\/index.php\/convert-openoffice-org-writer-rich-text-to-bb-code\/\">read more<\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[6],"tags":[],"_links":{"self":[{"href":"https:\/\/kryptech.name\/site\/index.php\/wp-json\/wp\/v2\/posts\/206"}],"collection":[{"href":"https:\/\/kryptech.name\/site\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/kryptech.name\/site\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/kryptech.name\/site\/index.php\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/kryptech.name\/site\/index.php\/wp-json\/wp\/v2\/comments?post=206"}],"version-history":[{"count":0,"href":"https:\/\/kryptech.name\/site\/index.php\/wp-json\/wp\/v2\/posts\/206\/revisions"}],"wp:attachment":[{"href":"https:\/\/kryptech.name\/site\/index.php\/wp-json\/wp\/v2\/media?parent=206"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/kryptech.name\/site\/index.php\/wp-json\/wp\/v2\/categories?post=206"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/kryptech.name\/site\/index.php\/wp-json\/wp\/v2\/tags?post=206"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}