Bug - Fixed Ferocious Bugbear doesn't trim properly

Theraze

Active member
> ash last_monster()

Returned: ferocious bugbear.</td></tr></table></td><td width=30></td><td><table><tr><td width=30><img src=http://images.kingdomofloathing.com/itemimages/nicesword.gif width=30 height=30 alt="enemy's attack power" title="enemy's attack power"></td><td width=50 valign=center align=left><font size=+2>13</font></td><td><img src=http://images.kingdomofloathing.com/itemimages/beastflavor.gif alt="this monster is a beast" title="this monster is a beast"></td></tr><tr><td width=30><img src=http://images.kingdomofloathing.com/itemimages/whiteshield.gif width=30 height=30 alt="enemy's defense" title="enemy's defense"></td><td width=50 valign=center align=left><font size=+2>12</font></td><td><img src=http://images.kingdomofloathing.com/itemimages/circle.gif width=30 height=30 alt="this monster has no particular elemental alignment." title="this monster has no particular elemental alignment."></td></tr><tr><td width=30><img src=http://images.kingdomofloathing.com/itemimages/hp.gif width=30 height=30 alt="enemy's hit points" title="enemy's hit points"></td><td width=50 valign=center align=left><font size=+2>15</font></td><td><img src=http://images.kingdomofloathing.com/itemimages/watch.gif alt="initiative +50%" title="initiative +50%"></td></tr></table></td></tr></table>
id => 0
base_hp => 0
base_attack => 0
base_defense => 0
raw_hp => -1
raw_attack => -1
raw_defense => -1
base_initiative => -1
raw_initiative => -1
attack_element => none
defense_element => none
physical_resistance => 0
min_meat => 0
max_meat => 0
base_mainstat_exp => 1.6666666666666667
phylum => none
poison => none
boss => false
image =>
images => aggregate boolean [string]
attributes =>
I have to say, ferocious bugbear.</td></tr></table></td><td width=30></td><td><table><tr><td width=30><img src=http://images.kingdomofloathing.com/itemimages/nicesword.gif width=30 height=30 alt="enemy's attack power" title="enemy's attack power"></td><td width=50 valign=center align=left><font size=+2>13</font></td><td><img src=http://images.kingdomofloathing.com/itemimages/beastflavor.gif alt="this monster is a beast" title="this monster is a beast"></td></tr><tr><td width=30><img src=http://images.kingdomofloathing.com/itemimages/whiteshield.gif width=30 height=30 alt="enemy's defense" title="enemy's defense"></td><td width=50 valign=center align=left><font size=+2>12</font></td><td><img src=http://images.kingdomofloathing.com/itemimages/circle.gif width=30 height=30 alt="this monster has no particular elemental alignment." title="this monster has no particular elemental alignment."></td></tr><tr><td width=30><img src=http://images.kingdomofloathing.com/itemimages/hp.gif width=30 height=30 alt="enemy's hit points" title="enemy's hit points"></td><td width=50 valign=center align=left><font size=+2>15</font></td><td><img src=http://images.kingdomofloathing.com/itemimages/watch.gif alt="initiative +50%" title="initiative +50%"></td></tr></table></td></tr></table> is quite the name.

My guess is that some part of the haiku parsing is failing, but... no real clue.
 

Theraze

Active member
Debug log of a run_combat() of post-fight where it's having the parsing problems.
 

Attachments

  • DEBUG_20150310.txt
    7.9 KB · Views: 40

Theraze

Active member
Yay! Looking forwards to testing this and having short names on all the haiku monsters again. Thanks Veracity! :)
 

Veracity

Developer
Staff member
I spent quite a few turns in the Haiku Dungeon with a multi, looking at every monster. I saw things like this:

Code:
<Table><tr><td valign=center align=left>When couplets go bad<br>there's always someone to blame:<br><b>Knob Goblin poseur</td></tr></table>
Really? You start the name with a bold ("b") tag, but don't bother closing it? That also happens with monsters that are named on the second line of haiku - which renders the third line in bold, too.

It is completely pointless reporting bad HTML via a KoL bug report; near as I can tell, the attitude is "if the browser can figure out what we intended and render it correctly, we don't need to fix anything". I could argue that they didn't "intend" for the third line of a haiku to be in bold just because the monster name on the second line is bold, but I am sure they still won't fix it if I report it. :)
 

Bale

Minion
I hate KoL's html. It's horrendous in so many ways. A thing he always does that drives me crazy is to use <p> as a paragraph break instead of properly surrounding a paragraph with <p></p> like it should be done. Urgh. Your example of not closing a <b> tag is even worse of course, just not as common.

And I'm quite convinced that Jick does not care.
 

heeheehee

Developer
Staff member
(Aside, </p> isn't necessary as per the HTML specification -- "A p element’s end tag may be omitted if the p element is immediately followed by an address, article, aside, blockquote, dir, div, dl, fieldset, footer, form, h1, h2, h3, h4, h5, h6, header, hr, menu, nav, ol, p, pre, section, table, or ul element, or if there is no more content in the parent element and the parent element is not an a element." KoL's penchant for generating malformed HTML is quite impressive, regardless.)
 

Bale

Minion
I did not know that was in the html specification. I agree with Darzil largely because I believe that kind of sloppiness breeds errors, but at least it is suppose to work with that.
 

lostcalpolydude

Developer
Staff member
I imagine that using PHP to concatenate the HTML doesn't make it easy to make it all consistent. That probably doesn't explain all of it though.
 
Top