aaron-em / rcirc-styles.el

Giving rcirc correct and complete support for mIRC-style color and attribute codes
GNU General Public License v2.0
5 stars 5 forks source link

Parser misbehaves on complex control code sequences #15

Open aaron-em opened 7 years ago

aaron-em commented 7 years ago

In this sequence:

They ^Bdon't ^]need ^_to ^]be ^C03opened ^Band ^]closed ^Bin ^]lifo ^C04order

the following style and color changes occur:

  1. Start bold - bold
  2. Start italic - bold, italic
  3. Start underline - bold, italic, underline
  4. End italic - bold, underline
  5. Start color (green foreground) - bold, underline, green
  6. End bold - underline, green
  7. Start italic - italic, underline, green
  8. Start bold - bold, italic, underline, green
  9. End italic - bold, underline, green
  10. Start color (red foreground, implicitly ending the green from 5 above) - bold, underline, red
  11. Implicitly end all styles at EOL

Whatever IRC client clsr uses renders this sequence thus:

image

that is, correctly, whereas rcirc-styles renders it thus:

image

which is clearly bogus - the color replacement is the only part that works; the changes of style aren't rendered at all.