Options

Cobranding bug with &nbsp?

ruttrutt Registered Users Posts: 6,511 Major grins
edited May 10, 2005 in SmugMug Support
Try a HTML header like this:
ABC<br> DEF

The first time I enter this and save it, the " " is replaced by a single space and the effect is what it should be; the DEF is indented by one space. If I then edit the field further, say by changing DEF to HIJ and reenter, the space is sitll there, buth the text after the break is no longer indented.
If not now, when?

Comments

  • Options
    {JT}{JT} Registered Users Posts: 1,016 Major grins
    edited May 9, 2005
    First, definetly not a cobranding bug. We don't go through your code and change it in any way - so it is a browser bug.

    Second, I can't replicate (granted, I am using the best browser in the (mac) world; Safari), so screenshots would be helpful to see if it is something I could further explain :)
  • Options
    ruttrutt Registered Users Posts: 6,511 Major grins
    edited May 9, 2005
    I reproduced with Safari 1.3. Here is shot of the Customize page just before submitting: http://rutt.smugmug.com/photos/21629242-O.jpg And here it is immediately after submitting: http://rutt.smugmug.com/photos/21629250-O.jpg
    If not now, when?
  • Options
    winnjewettwinnjewett Registered Users Posts: 329 Major grins
    edited May 9, 2005
    {JT} wrote:
    First, definetly not a cobranding bug. We don't go through your code and change it in any way - so it is a browser bug.

    Second, I can't replicate (granted, I am using the best browser in the (mac) world; Safari), so screenshots would be helpful to see if it is something I could further explain :)
    JT, this is the same bug that was causing my © to turn into © when edited.

    -winn
  • Options
    ruttrutt Registered Users Posts: 6,511 Major grins
    edited May 9, 2005
    winnjewett wrote:
    JT, this is the same bug that was causing my © to turn into © when edited.

    -winn

    Please, can you expand or provide a pointer? Is there a workaround?
    If not now, when?
  • Options
    {JT}{JT} Registered Users Posts: 1,016 Major grins
    edited May 9, 2005
    Ok, I get it now. I never saw the copyright bug - as I was viewing your code after you had submitted it. If you go back to edit the code and resubmit then it converts the characters. This may be tricky to fix, let me think about it first.
  • Options
    winnjewettwinnjewett Registered Users Posts: 329 Major grins
    edited May 9, 2005
    {JT} wrote:
    Ok, I get it now. I never saw the copyright bug - as I was viewing your code after you had submitted it. If you go back to edit the code and resubmit then it converts the characters. This may be tricky to fix, let me think about it first.
    I think the solution is to replace "&" with "&" when your code outputs the values of the text fields.

    So "©" becomes "&copy;", " " becomes "&nbsp;", etc...

    Does this work?
    -winn
  • Options
    {JT}{JT} Registered Users Posts: 1,016 Major grins
    edited May 9, 2005
    yes, that is the solution that I had in mind - but there are other things that should remain untouched such as > < etc. I just need to think of how to set it up so that not everything that is put into the field is converted.
  • Options
    winnjewettwinnjewett Registered Users Posts: 329 Major grins
    edited May 9, 2005
    {JT} wrote:
    yes, that is the solution that I had in mind - but there are other things that should remain untouched such as > < etc. I just need to think of how to set it up so that not everything that is put into the field is converted.
    But if someone actually typed in > wouldn't they want the symbol to show up? If you don't parse it, it will turn into a '<', which the browser might think is part of some html code.

    -winn
  • Options
    {JT}{JT} Registered Users Posts: 1,016 Major grins
    edited May 9, 2005
    Untouched = do not translate into a > symbol.
  • Options
    winnjewettwinnjewett Registered Users Posts: 329 Major grins
    edited May 10, 2005
    {JT} wrote:
    Untouched = do not translate into a > symbol.
    I'm not sure I follow.

    If I type in
    <i>don't italicize</i>
    to my footer, that means that I am trying to display the text, inlcuding the italics brackets.

    When your php code generates the text for the textarea, if it replaces & with &amp;, the code will remain intact.

    -winn
  • Options
    colourboxcolourbox Registered Users Posts: 2,095 Major grins
    edited May 10, 2005
    This is definitely a bug which was acknowledged by smugmug when I mentioned it a few weeks ago via e-mail.

    In my case, I attempt to avoid spambots by encoding my e-mail address with alternate encoding. For example, I enter the address "mail@server.com" as & #109; & #97; & #105; & #108; & #64; & #115; & #101; & #114; & #118; & #101; & #114; & #46; & #99; & #111; & #109; (extra space inserted after each & sign to prevent conversion on this forum)

    When I enter this code into my co-branding HTML, it shows up properly in the browser's source view, but if I later edit the co-branding HTML, the above codes are converted into plain text. Therefore I understand the request to "leave it alone," because that's what I want too.

    While not foolproof (some spambots are said to know about it), I've gotten almost no spam on my other site by entering my e-mail this way.

    BTW, I am also using Safari but of course this is not browser-dependent because the translation is happening in the smugmug co-branding engine.
  • Options
    winnjewettwinnjewett Registered Users Posts: 329 Major grins
    edited May 10, 2005
    {JT} wrote:
    Untouched = do not translate into a > symbol.
    I just reread your posts, and I think we're on the same page, but I'm not sure. Can you think of any instance where replacing an & with &amp ; would screw things up?

    -winn
  • Options
    {JT}{JT} Registered Users Posts: 1,016 Major grins
    edited May 10, 2005
    We are (were) on the same page. This has already been fixed and is waiting to go out.
    winnjewett wrote:
    I just reread your posts, and I think we're on the same page, but I'm not sure. Can you think of any instance where replacing an & with &amp ; would screw things up?

    -winn
Sign In or Register to comment.