geeky · wp hacks

multimore won't validate

tried working on the multimore hack, refer this – i finally figured it out how to write a plugin but i just can not get it to validate xhtml strict 😦 the problem is it cuts in between <p> and </p> so you will have something like

<p>this is before and
<div>read more link
</p> – p got closed in the display: none div and then
another <p> starts in the display: none div and after
the div, there goes another </p>

that clearly violates xhtml rule. the only possible way to get around it would be to strip all the p tags in the message and replace them with line breaks. but that really screws up the format of the entry.

if only i could write some kind of function that’d fix mismatching p tags in the entry, then it will be more perfect. i based my hack completely on this exisiting hack. if i ever think it’s good enough to be released, i will. here’s a little demo

  • this is a test for list
  • this is a test for list

blah blah


it’s based on this hack so the syntax is no longer <!–more–> <!–endmore–> it’s now <!–cut=with unique read more text allowed–> and <!–/cut–> much like lj style

some more blah blah

8 thoughts on “multimore won't validate

  1. hmmm maybe you could somehow tweek the hack so that there’s a blahblah ? So the paragraph tag get’s closed before the div, and another one get’s open after it?

    though yea, that will might screw up the format of the entry.. like being unable to include a cut tag within a paragraph… but… for the greater good? lol..
    or how about writting another separate hack to do exactly what you said, to strip the paragraph tags, and replace them with br ones? I personally am not a real fan of the paragraph tag x))

    1. errr… the code i wanted to post in the above comment kind of screwed up =\

      but yea it was something like
      blah blah
      so there’s a paragraph tag that closed before, the div, and opens after it x)

      1. and err -________-” putting spaces between the tags didn’t work =((… hopfully u can see the tags in my comment when you’re logged into wp xD

    2. actually i kinda realized that the entry is formatted after the hack. the plugin has higher priority so the <p> tags are added afterwards. i suppose i can lower the priority of the hack. either way it has to be done with regular expression and i suck at it XP

    1. well this is something i hacked so i should know. but i think i got it validate now. just don’t know how well it will present all different types of entry format.

  2. I use my own popup script in wp which I adopted over time and it works well, but the ‘onClick’ in the a-href tag does not validate and it’s the only error my wp pages create – seing that your script also uses the same comment, I’m curious to know if there is a solution to this problem?

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s