Member Avatar for iamthwee

http://www.daniweb.com/software-development/cpp/code/455970/quadratic-equation-solver-c-sub-routine

hope this isn't just me again, but the htmlentities don't seem to render properly

Recommended Answers

All 12 Replies

That's really weird!

The problem I believe is that special characters like < and > don't require conversion to their HTML entity counterpart when placed inside a pre since the rendering engine just "literally" evaluates them as opposed to recognizing the sequence and rendering it as the corresponding special char. Daniweb code snippet handling code seems to be converting the special chars to HTML entities which is not really required.

Member Avatar for iamthwee

Other code snippnets render OK the only difference is the OP of that link I posted didn't include the standard #iostream headers.

This snippet without headers doesn't seem to have this problem. There is one more possiblity which I missed the first time: the OP might have actually posted the HTML escaped code snippet. I have posted a comment on that snippet thread; let's see what he has to say.

Member Avatar for iamthwee

Could be... although that was three years ago so the new DW parsing engine might not have affected that.

That being said, it might be doing something funky if he is copying and pasting code from another app.

. . . There is one more possiblity which I missed the first time: the OP might have actually posted the HTML escaped code snippet. I have posted a comment on that snippet thread; let's see what he has to say.

Hi, "~s.o.s~".

I replied to you in that thread. And added another comment.

Also, yes, I did copy and paste from another app. I did a copy and paste from the Visual Studio 2012 IDE to a plaintext document (TextPad) to strip out all formatting. Then I did a copy and paste from TextPad to the Code Snippet window. But I don't think that is the issue. I follow this routine for almost all my writing--copying from a plaintext editor to ensure no weird behaviour--and it has worked out fine so far. And my other code snippet, for the Matrix Multiplication Program, appears just fine.

I guess we'll have to wait for some feedback from Dani, to know what may have happened.

Just got confirmation back from David saying that he didn't post it that way. So it boils down to the post snippet routine doing something funny.

Dani/Decepti-kun, one for you I guess?

I have a bit of a headache and have been in and out of bed all day, so it's hard for me to concentrate on a code investigation right now :(

With the particular code snippet being discussed here, the poster accidentally put the description in the code snippet place and the code snippet in the description place. I reversed the two and must have / might have screwed something up in doing so.

commented: finger-of-blame.jpg :) +0

What are the options for fixing it?
Should I re-post the original code in another post, same thread?
Could we delete the entire thread and I will create a brand-new one?
Do Mods have the capability to edit the code? Perhaps I could be made a Mod for one hour and then I could correct the code myself; it shouldn't take long.

If you can post the entire code once again in your code snippet thread, I can update your original post.

Okay. I just re-posted the code snippet. Hope this works.

@David: I just tried posting your new snippet in the original post but it still doesn't work.

@Dani, this is something to look into. You can reproduce this by trying to update David's original code snippet based on his latest post.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.