/************************************

  "waka" is a Japanese poetry 
         composed of 31 syllables. 

  (c) 2005 Pixel-Apes.

  -----------------------------------

  Headers (as decoration) markup:
  
  ==H1 header==
  ===H2 header==
  ...
  ======H5 header==

*************************************/


function wakaDecorationHeaders() {}
         wakaDecorationHeaders.prototype = new wakaToken();
         wakaDecorationHeaders.prototype.constructor = 
         wakaDecorationHeaders;

// static
wakaDecorationHeaders.prototype.getRegexpPart = function()
{
  return "((^|\n)[\r\t ]*={2,6}(.)*?==+)";
}
                                        //   1          2
wakaDecorationHeaders.prototype.isRE  = /^\s*(={2,6})\s*(.*?)\s*==+$/;
wakaDecorationHeaders.prototype.is = function( outerText )
{
  var matches = this.isRE.exec( outerText );
  if (matches !== null) 
    return {
            inner : matches[2],
            level : matches[1].length-1,
            text  : outerText
           };
  return false;
}



// private (compilation)
wakaDecorationHeaders.prototype._compile   = function()
{
  var inner = this.wf.format( this._data.inner, "default" );
  this._html = "<h"+this._data.level+">"+ inner +"</h"+this._data.level+">";
}







