vikkievignesh / whizzywig

Automatically exported from code.google.com/p/whizzywig
MIT License
0 stars 0 forks source link

content shown in editor is deformed after submit #3

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?

See examples at end of post. This is a file with mixed html/php. The way whizzy 
currently behaves, it CANNOT be used for editing content with embedded script 
source.

None of the other designMode scripts I've tried have this problem, so I don't 
think it's Chrome or IE8 specific.

What is the expected output? What do you see instead?

I expect what I see in the editor to be returned after the submit. I see the 
text correctly (ie, the FROM text in the examples) in the editor, but what I 
get back from the submit/POST is in the TO examples.

What version of the product are you using? On what operating system?

61 whizzy
chrome 7 & ie8
vista

Please provide any additional information below.

FROM:
   <h3>Contact Form &amp; &lt;Test&gt;</h3>
   <?php
       ...
   ?>

TO:
   <h3>Contact Form &amp; &lt;Test&gt;</h3>
   <!--?php
       ...
   ?&gt;

-------------------------------------------------------------------------------

FROM:
   if (!$resp->is_valid) {

TO:
   if (!$resp--->is_valid) {

-------------------------------------------------------------------------------

FROM:
   $headers = "From: \"$fullname\" <$fromemail>" . $headersep
        . "Reply-To: \"$fullname\" <$email>" . $headersep
        . "X-Mailer: chfeedback.php...";

TO:
   $headers = "From: \"$fullname\" &lt;$fromemail&gt;" . $headersep
        . "Reply-To: \"$fullname\" &lt;$email&gt;>" . $headersep
        . "X-Mailer: chfeedback.php...";

-------------------------------------------------------------------------------

FROM:
   } elseif ($result>0) {

TO:
   } elseif ($result&gt;>0) {

-------------------------------------------------------------------------------

FROM:
   echo '<hr /><p class="errmsg">ERROR: ';
   if ($result & 1) { echo 'Invalid Email'; $msgjoin=' + '; }
   if ($result & 2) { echo $msgjoin.'Missing Fields'; $msgjoin=' + '; }
   echo ".</p><hr />\n";

TO:
   echo '<hr />
<p class="errmsg">ERROR: ';
   if ($result &amp; 1) { echo 'Invalid Email'; $msgjoin=' + '; }
   if ($result &amp; 2) { echo $msgjoin.'Missing Fields'; $msgjoin=' + '; }
   echo ".</p>
<hr />\n";

-------------------------------------------------------------------------------

FROM:
   <?php } ?>

TO:
   <!--?php } ?-->

-------------------------------------------------------------------------------

FROM:
   <input ... value="<?php echo ($refill && isset($_POST['fullname'])) ? htmlentities($_POST['fullname']) : "" ?>" />

TO:
   <input ... value="&lt;?php echo ($refill &amp;&amp; isset($_POST['fullname'])) ? htmlentities($_POST['fullname'])) ? htmlentities($_POST['fullname']) : " "="" ?="" />" /&gt;

-------------------------------------------------------------------------------

FROM:
   <textarea rows="15" cols="45" name="comments" id="tswcomments"><?php
    echo ($refill && isset($_POST['comments'])) ? '...' : '...';
   ?></textarea>

TO:
   <textarea rows="15" cols="45" name="comments" id="tswcomments">&lt;?php
    echo ($refill &amp;&amp; isset($_POST['comments'])) ? '...' : '...';
   ?></textarea>

-------------------------------------------------------------------------------

FROM:
   <noscript>
      <iframe src="http://api.recaptcha.net/noscript?k=<?php echo $my_recaptcha_public_key ?>" height="300" width="500" frameborder="0" title="CAPTCHA test"><
      <br />
      <label for="tswcaptcha">Copy and paste the code provided in above box here:</label><br />
      <textarea name="recaptcha_challenge_field" id="tswcaptcha" rows="3" cols="40"></textarea>
      <input type="hidden" name="recaptcha_response_field" value="manual_challenge" />
   </noscript>

TO:
   <noscript>
      &lt;iframe src="http://api.recaptcha.net/noscript?k=&lt;?php echo $my_recaptcha_public_key ?&gt;" height="300" width="500" frameborder="0" title="CAPTCH
      &lt;br /&gt;
      &lt;label for="tswcaptcha"&gt;Copy and paste the code provided in above box here:&lt;/label&gt;&lt;br /&gt;
      &lt;textarea name="recaptcha_challenge_field" id="tswcaptcha" rows="3" cols="40"&gt;&lt;/textarea&gt;
      &lt;input type="hidden" name="recaptcha_response_field" value="manual_challenge" /&gt;
   </noscript>

Original issue reported on code.google.com by grimblef...@gmail.com on 18 Oct 2010 at 11:20

GoogleCodeExporter commented 8 years ago
designMode does not preserve script tags in most browsers - other editors 
handle this by post-processing - not looking to add this level of 
sophistication into Whizzywig at this stage, but submitted solutions will be 
considered.

Original comment by unve...@gmail.com on 9 Nov 2010 at 1:14