<?xml version="1.0" encoding="utf-8"?>
<?xml-stylesheet type="text/xsl" href="https://shazwazza.com/rss/xslt"?>
<rss xmlns:a10="http://www.w3.org/2005/Atom" version="2.0">
  <channel>
    <title>Shazwazza</title>
    <link>https://shazwazza.com/</link>
    <description>My blog which is pretty much just all about coding</description>
    <generator>Articulate, blogging built on Umbraco</generator>
    <image>
      <url>/media/0libq25y/frog.png?rmode=max&amp;v=1da0e911f4e6890</url>
      <title>Shazwazza</title>
      <link>https://shazwazza.com/</link>
    </image>
    <item>
      <guid isPermaLink="false">1276</guid>
      <link>https://shazwazza.com/post/more-on-umbraco-tinymce-and-flash/</link>
      <category>Umbraco</category>
      <title>More on Umbraco, TinyMCE and Flash</title>
      <description>&lt;div class="imported-post"&gt;This post was imported from FARMCode.org which has been discontinued. These posts now exist here as an archive. They may contain broken links and images.&lt;/div&gt;In a previous post &lt;a href="http://farmcode.org/post/2010/01/07/Umbraco-TinyMCE-Customization-for-Flash-Rich-Text.aspx" target="_blank"&gt;Shannon explained how to customise TinyMCE for what HTML elements Flash actually supports&lt;/a&gt;, and he finished off the post with showing how to cleanup line breaks.&lt;/p&gt;  &lt;p&gt;To do this he used an XSLT function called &lt;strong&gt;&lt;em&gt;normalize-space&lt;/em&gt;&lt;/strong&gt;, which is great &lt;em&gt;if you’re using XSLT!&lt;/em&gt;&lt;/p&gt;  &lt;p&gt;I was writing a service today which was using LINQ to XML to generate the XML for Flash, but that posed a problem, how do you deal with Flash wanting to do hard breaks on new line constants?&lt;/p&gt;  &lt;p&gt;Easy, &lt;a href="http://msdn.microsoft.com/en-us/library/system.string.replace.aspx" target="_blank"&gt;string.Replace&lt;/a&gt; to the rescue!&lt;/p&gt;  &lt;p&gt;Here’s a handy little extension method you can drop into your code libraries:&lt;/p&gt;  &lt;pre&gt;public static string NormalizeSpace(this string s) {
	if(s == null) throw new ArgumentNullException(&amp;quot;s&amp;quot;);
	return s.Replace(&amp;quot;\r\n&amp;quot;, string.Empty)
		.Replace(&amp;quot;\r&amp;quot;, string.Empty)
		.Replace(&amp;quot;\n&amp;quot;, string.Empty);
}&lt;/pre&gt;

&lt;p&gt;Nice and easy (and unsurprisingly logical!).&lt;/p&gt;</description>
      <pubDate>Thu, 23 Mar 2023 15:08:14 Z</pubDate>
      <a10:updated>2023-03-23T15:08:14Z</a10:updated>
    </item>
    <item>
      <guid isPermaLink="false">1287</guid>
      <link>https://shazwazza.com/post/umbraco-tinymce-customization-for-flash-rich-text/</link>
      <category>Umbraco</category>
      <title>Umbraco TinyMCE Customization for Flash Rich Text</title>
      <description>&lt;div class="imported-post"&gt;This post was imported from FARMCode.org which has been discontinued. These posts now exist here as an archive. They may contain broken links and images.&lt;/div&gt;Flash doesn’t support most of the html elements of a standard web page. TinyMCE’s creators Moxiecode have thankfully given us the TinyMCE rules for flash here:&lt;/p&gt;  &lt;p&gt;&lt;a title="http://wiki.moxiecode.com/index.php/TinyMCE:Configuration/valid_elements#Full_FlashMX_2004_rule_set:" href="http://wiki.moxiecode.com/index.php/TinyMCE:Configuration/valid_elements#Full_FlashMX_2004_rule_set:"&gt;http://wiki.moxiecode.com/index.php/TinyMCE:Configuration/valid_elements#Full_FlashMX_2004_rule_set:&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;So to get Umbraco &amp;amp; TinyMCE working to give your flash application the markup that it needs you need to modify your &lt;em&gt;\config\tinyMceConfig.config&lt;/em&gt; file:&lt;/p&gt;  &lt;pre&gt;&amp;lt;validElements&amp;gt;
    &amp;lt;![CDATA[+a[href|target],
+b,
+br,
+font[color|face|size],
+img[src|id|width|height|align|hspace|vspace],
+i,
+li,
+p[align|class],
+h1,
+h2,
+h3,
+h4,
+h5,
+h6,
+span[class],
+textformat[blockindent|indent|leading|leftmargin|rightmargin|tabstops],
+u
]]&amp;gt;
&amp;lt;/validElements&amp;gt;&lt;/pre&gt;

&lt;p&gt;Then there’s the issue that flash treats real line breaks and &amp;lt;br/&amp;gt; tags exactly the same! This will probably cause you a few headaches trying to work that out. So to save you that headache, you need to output the rich text markup via XSLT to flash using the XSLT function: &lt;em&gt;&lt;strong&gt;normalize-space&lt;/strong&gt;&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Something like:&lt;/p&gt;

&lt;pre&gt;&amp;lt;xsl:value-of select=&amp;quot;normalize-space($myRichTextValue)&amp;quot; /&amp;gt;&lt;/pre&gt;</description>
      <pubDate>Thu, 23 Mar 2023 15:08:14 Z</pubDate>
      <a10:updated>2023-03-23T15:08:14Z</a10:updated>
    </item>
  </channel>
</rss>