Uploaded image for project: 'XWiki Platform'
  1. XWiki Platform
  2. XWIKI-279

Support GraphViz label orientation control-characters \l, \n and \r

    XMLWordPrintable

Details

    • Improvement
    • Resolution: Fixed
    • Trivial
    • 5.4-rc-1
    • 0.9.840
    • Other
    • None
    • Tomcat 4.1.30, Windows2003
    • N/A
    • N/A

    Description

      I can't get the label orientation characters for GraphViz (\l, \r, \n) to work - so I changed the source of GraphVizPlugin

      <diff>
      112c112
      < fwriter.write(content);

      > fwriter.write(preserveGraphVizControls(content)); //
      > restore control commands
      219a220,253
      >
      >
      > /**
      > * Try to preserve/restore the GraphViz label formatting characters
      > * \l, \r, \n, \<blank> and \N.
      > *
      > * @param content body of the

      {graphviz}

      -tag
      > * @return a string, where the mentioned characters are restored
      > */
      > private String preserveGraphVizControls(String content) {
      > if (content != null) {
      > StringBuffer result = new StringBuffer(content);
      > int pos;
      > while ((pos = result.indexOf(" ")) >= 0)

      { > result.replace(pos, (pos+5), "\\ "); > }

      > while ((pos = result.indexOf("N")) >= 0)

      { > result.replace(pos, (pos+5), "\\N"); > }

      > while ((pos = result.indexOf("l")) >= 0)

      { > result.replace(pos, (pos+6), "\\l"); > }

      > while ((pos = result.indexOf("n")) >= 0)

      { > result.replace(pos, (pos+6), "\\n"); > }

      > while ((pos = result.indexOf("r")) >= 0)

      { > result.replace(pos, (pos+6), "\\r"); > }

      > return result.toString();
      > } else

      { > return null; > }

      > }
      >
      </diff>

      after that, my label justifiying worked.
      Mabye it's possible to promote this change to the codebase ...

      Attachments

        Activity

          People

            sdumitriu Sergiu Dumitriu
            baloo66 Alexander Eller
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: