I have a problem with a custom formatter - anything I put there shows
up as a single line in IE. In Firefox it displays multiple lines ok,
but if I copy from there to clipboard it's single line.

What do I need to change to keep newlines when copying to clipboard? I
don't care so much about displaying in IE as I don't use it for TW.

Thanks.

================================================

config.formatters.push
({
  name          : "terminalOutput",
  match         : "^(?:\\${2})\\n|(?:\\${2})",
  lookahead     : undefined,
  element       : undefined,
  style         : "terminal",
  handler       : function(w)
  {
    switch(w.matchText) {
      case "$$\n":      // div
        this.lookahead = "^\\${2}\\n((?:^[^\\n]*\\n)+?)(^\\${2}$\
\n?)";
        this.element = "div";
        break;
      case "$$":        // span
        this.lookahead = "(?:\\${2})((?:.|\\n)*?)(?:\\${2})";
        this.element = "span";
        break;
      default:
        break;
    }
    var lookaheadRegExp = new RegExp(this.lookahead,"mg");
    lookaheadRegExp.lastIndex = w.matchStart;
    var lookaheadMatch = lookaheadRegExp.exec(w.source)
    if(lookaheadMatch && lookaheadMatch.index == w.matchStart)
    {
      var e = createTiddlyElement
(w.output,this.element,null,this.style,lookaheadMatch[1]);
      w.nextMatch = lookaheadMatch.index + lookaheadMatch[0].length;
    }
  }
});

setStylesheet("                         \
.terminal {                                     \
    padding: 0px 1px ;                  \
    border: 2px solid #9db9c8 ; \
    background: #000 ;          \
    color: #bbb ;                               \
    font-family: fixed ;                        \
    white-space: pre ;                  \
}                                               \
div.terminal {                          \
    margin: 12px 32px ;         \
}                                               \
","zFormattersStyleSheet");

================================================

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"TiddlyWikiDev" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/TiddlyWikiDev?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to