moovweb / tritium

Tritium is a magical document modifying language. It's JavaScript-like and simple to learn. Think XSLT without the nightmare. It was designed by Hampton Catlin (@hcatlin), and has been heavily influenced by Aaron Leung (@akhleung).
http://tritium.io
Mozilla Public License 2.0
33 stars 7 forks source link

ends-with crash #23

Closed hoisie closed 6 years ago

hoisie commented 12 years ago

This crashes tritium-tester. Seems to be a problem with ends-with. It shouldn't crash.

HTML:

<html>
  <head>
    <title> Title </title>
  </head>
  <body>
    <div id="header"><div class="logo">Website Logo</div></div>
    <h1> Welcome to Tritium Tester </h1>
    <div data-ur-set='toggler'></div>
        <div data-ur-set='toggler'></div>
        <div data-ur-set='toggler'></div>
    <a href='hellogoodbye'></a>
    <span>a</span>
   </body>
</html> 
html() {
  $("/html") {
    $("./head/title") {
      text("Changed the title~")
    }

    $("./body/h1") {
      text("Changed the header~")
    }

    $("./body") {

      $("./a[ends-with(@href='goodbye')]") {
       name("div")
      }
    }
  }
}