Page 1 of 1

[BUG/PLUGIN/EDITOR]<br /> in <pre>

Posted: Sat Sep 10, 2011 2:55 pm
by Jragon
Hi!

I've just installed Serendipity, and I love it...

Here is my blog page that has the error: http://jragon.co.uk/blog/index.php?/arc ... ipity.html

So, in the code bit you can see the <br /> but I don't want it to. In the editor(not WYSIWYG) I put in:

Code: Select all

Hi Guys.

As you may know this blog is running on Serendipity. The Serendipity is rather interesting for a blog system, although manic in the templating department.

Serendipity useses Smarty, which isn't too bad, but it certainly could be better. The default template is horrid, I've editited the CSS sheet a bit though

Here are the bits I changed;
<pre name="code" class="css">
#mainpane {
    border-bottom: 1px solid #000000;
    margin: auto;
    width: 888px;
    border-top: 0px;
    background-color: #FFFFFF;
    border-top: 1px solid #000000;
    border-left: 1px solid #000000;
    border-right: 1px solid #000000;
}

#serendipity_banner{
    height: 72px;
    margin: auto;
    width: 886px;
    border-top: 0px;
    background-color: #FFFFFF;
    border-top: 1px solid #000000;
    border-left: 1px solid #000000;
    border-right: 1px solid #000000;
    color: #000000;
}

</pre>


I like the new style... It's very simple.

Serendipity:
The occurrence and development of events by chance in a happy or beneficial way

Finding this blog system was a stroke of Serendipity :P

I do have to say, I like this system, it's so much easier to use rather than Wordpress.

Thanks for reading

Jragon
It should know what <pre> means pre formatted so you don't need the brake tags..

How can I fix this

Thanks

Jragon

Re: [BUG/PLUGIN/EDITOR]<br /> in <pre>

Posted: Sat Sep 10, 2011 4:19 pm
by Timbalu
simply use the nl2br plugin as build in, which has a nl2p option, which turns all your entries to have non- automatic <br tags> or use the advanced one at http://board.s9y.org/viewtopic.php?f=2&t=17544&start=0 to use newlines to brs as normally, but exclude them in entries by a manually added exclude tag, like <nl> here no new line tags </nl>.

Re: [BUG/PLUGIN/EDITOR]<br /> in <pre>

Posted: Sat Sep 10, 2011 4:59 pm
by yellowled
Timbalu wrote:but exclude them in entries by a manually added exclude tag, like <nl> here no new line tags </nl>.
Please also note that <nl> is not actually a vaild HTML element but merely a placeholder example.

YL

Re: [BUG/PLUGIN/EDITOR]<br /> in <pre>

Posted: Sat Sep 10, 2011 5:26 pm
by Jragon
Hmm...


Doing:
Hi!

Syntax highlighting in Serendipity is very very easy... All you need is 2 plugins...

nl2br edit: http://board.s9y.org/viewtopic.php?f=2&t=17544&start=0
dp syntax highlight: http://board.s9y.org/viewtopic.php?f=4&t=10014&start=0

dp syntax highlight, is the syntax highlighter, you use tags like:
<pre>
<pre name="code" class="php">
</pre>

But that on it's own, gives you the little brake tag on the end of each line.. Which is annoying.

<pre name="code" class="php">
<?php
echo "hello world";
?>
</pre>

But with the nl2br edit, you use a tag; <pre> <nl> </pre> and that basically stops there being a brake tag on the end of each line. So, it now looks like:

<nl>
<pre name="code" class="php">
<?php
echo "hello world";
?>
</pre>
</nl>

That's:
<nl>
<pre>
<nl>
<pre name="code" class="php">
<?php
echo "hello world";
?>
</pre>
</nl>
</pre>
</nl>
gives me:

http://jragon.co.uk/blog/index.php?/arc ... pity..html

Which is some what all screwed up :S

Re: [BUG/PLUGIN/EDITOR]<br /> in <pre>

Posted: Sat Sep 10, 2011 6:35 pm
by Timbalu
Just use

Code: Select all

<nl>
<pre name="code" class="php">
<?php
echo "hello world";
?>
</pre>
</nl>
and do not talk about using <nl></nl> in your post ;-)
If you have to use it, make sure your syntaxhighlighter spits out htmlentites() or htmlspecialchars() encoded syntax - like

Code: Select all

<pre><code class="code-php"><span style="color: rgb(0, 0, 0);">
<span style="color: rgb(0, 0, 187);"><?php
</span><span style="color: rgb(0, 119, 0);">function&nbsp;</span>.....etc. ...

Re: [BUG/PLUGIN/EDITOR]<br /> in <pre>

Posted: Sat Sep 10, 2011 7:02 pm
by Jragon
Okay..

Well... Now it gives me <!--- when I do <?php

http://jragon.co.uk/blog/index.php?/arc ... pity..html

It's very annoying... How do I stop this?

Re: [BUG/PLUGIN/EDITOR]<br /> in <pre>

Posted: Sat Sep 10, 2011 8:02 pm
by Timbalu
<!?php is not <?php ;-)
the syntaxhighlighter still does not encode things like < or >, which is normally done if you just use <pre><code> without a syntax plugin, as far as I remember.

Maybe you have to set this in the config of the plugin, or try moving the highligter plugin down the event plugin list and save, so it will highlight at last.