Andreas:
--------------------------------------------------------------------------------
Can you please give a small example of code that we can copy as HTML and then
paste into a document to see what you are doing?
--------------------------------------------------------------------------------
Hi Andreas,
Instead of this:
<head>
<style type="text/css">
.cpp1-comment { color: #008000; font-style: italic; }
.cpp1-space { color: #008080; font-style: italic; }
.cpp1-brackets { color: #000000; }
.cpp1-string { color: #800000; }
.cpp1-reservedword { font-weight: bold; }
</style>
</head>
<pre><code><span class="cpp1-comment">// Format a COLORREF as an RGB string
</span><span class="cpp1-identifier">CString</span><span class="cpp1-space">
</span><span class="cpp1-identifier">CColorCalc::FormatRGB(</span><span
class="cpp1-space"> </span><span class="cpp1-identifier">COLORREF</span><span
class="cpp1-space"> </span><span class="cpp1-identifier">clrRGB</span><span
class="cpp1-space"> </span><span class="cpp1-brackets">)
{
</span><span class="cpp1-space"> </span><span
class="cpp1-identifier">CString</span><span class="cpp1-space"> </span><span
class="cpp1-identifier">strRGB;
</span><span class="cpp1-space"> </span><span
class="cpp1-identifier">UINT</span><span class="cpp1-space"> </span><span
class="cpp1-identifier">nRed=GetRValue(clrRGB)
</span><span class="cpp1-space"> </span><span
class="cpp1-symbol">,</span><span
class="cpp1-space"> </span><span
class="cpp1-identifier">nGreen=GetGValue(clrRGB)
</span><span class="cpp1-space"> </span><span
class="cpp1-symbol">,</span><span
class="cpp1-space"> </span><span
class="cpp1-identifier">nBlue=GetBValue(clrRGB);
</span><span class="cpp1-space"> </span><span
class="cpp1-identifier">strRGB.Format(</span><span
class="cpp1-string">"%d,%d,%d"</span><span class="cpp1-symbol">,</span><span
class="cpp1-space"> </span><span class="cpp1-identifier">nRed,</span><span
class="cpp1-space"> </span><span class="cpp1-identifier">nGreen,</span><span
class="cpp1-space"> </span><span class="cpp1-identifier">nBlue);
</span><span class="cpp1-space"> </span><span
class="cpp1-reservedword">return</span><span class="cpp1-space"> </span><span
class="cpp1-identifier">strRGB;
}
</span></code></pre>
.. I would like to use inline styles, which is this:
<pre><code><span style="color: #008000;font-style: italic;">// Format a
COLORREF as an RGB string
</span><span>CString</span><span style="color: #008080;font-style: italic;">
</span><span>CColorCalc::FormatRGB(</span><span style="color:
#008080;font-style: italic;"> </span><span>COLORREF</span><span style="color:
#008080;font-style: italic;"> </span><span>clrRGB</span><span style="color:
#008080;font-style: italic;"> </span><span style="color: #000000;">)
{
</span><span style="color: #008080;font-style:
italic;"> </span><span>CString</span><span style="color:
#008080;font-style:
italic;"> </span><span>strRGB;
</span><span style="color: #008080;font-style:
italic;"> </span><span>UINT</span><span style="color: #008080;font-style:
italic;"> </span><span>nRed=GetRValue(clrRGB)
</span><span style="color: #008080;font-style:
italic;"> </span><span>,</span><span style="color:
#008080;font-style:
italic;"> </span><span>nGreen=GetGValue(clrRGB)
</span><span style="color: #008080;font-style:
italic;"> </span><span>,</span><span style="color:
#008080;font-style:
italic;"> </span><span>nBlue=GetBValue(clrRGB);
</span><span style="color: #008080;font-style:
italic;"> </span><span>strRGB.Format(</span><span style="color:
#800000;">"%d,%d,%d"</span><span>,</span><span style="color: #008080;font-style:
italic;"> </span><span>nRed,</span><span style="color: #008080;font-style:
italic;"> </span><span>nGreen,</span><span style="color: #008080;font-style:
italic;"> </span><span>nBlue);
</span><span style="color: #008080;font-style: italic;"> </span><span
style="font-weight: bold;">return</span><span style="color: #008080;font-style:
italic;"> </span><span>strRGB;
}
</span></code></pre
This is easier to paste into a page (in my opinion) because all it requires is a
simple paste into the target position in the html.
(I think the html for BOTH examples will probably look horrible on the forum
page but if you copy/paste them into separate documents in your favourite html
editor you should see they both render the same but the second example uses
inline styles instead of classes and a page-based <style> tag within the
<head>.
The problem with the first html quoted,the way PSPad does it currently, is that
the <head> tag is probably already in the target page anyway and the <style>
tag, within the <head> tag, would need to be manually separated from the code
html where you are looking to paste what PSPad exported to the clipboard into an
existing (i.e. already has some content) html document.
I hope I've explained that clearly!
By the way, in attempting to convert from the exported format to the converted
for this message I found http://templates.mailchimp.com/resources/inline-css/
which does most of the conversion to inline automatically. One can ignore the
<head> tag in the result but I had to also manually remove the redundant 'class'
identifiers in the html to get to my cleaned up version used as the second
example in this message.
In any case, I really don't want to be going this route if I can help it...
hence my feature request for PSPad to have the option to export with inline
styles.
Regards,
Pete
--
<http://forum.pspad.com/read.php?2,64676,64682>
PSPad freeware editor http://www.pspad.com