glejeune / Ruby-Graphviz

[MIRROR] Ruby interface to the GraphViz graphing tool
https://gitlab.com/glejeune/ruby-graphviz
Other
608 stars 116 forks source link

Backslash at the end of string labels cause syntax errors #137

Open jonahroth opened 6 years ago

jonahroth commented 6 years ago

Ruby 2.4.3 GraphViz 2.40.1

2.4.3 :001 > require 'ruby-graphviz'
 => true
2.4.3 :002 > g = GraphViz.new(:G, type: :digraph)
2.4.3 :003 > g.add_nodes("Hello\\")
2.4.3 :004 > g.output(png: 'hello.png')
RuntimeError: Error from ["/usr/local/bin/dot", "-q1", "-Tpng", "-ohello.png", "/var/folders/lr/j9_k_wf91r92xbjc2n6v9f6wg255_9/T/graphviz.rb20180924-74351-8tovlm"]:
Error: /var/folders/lr/j9_k_wf91r92xbjc2n6v9f6wg255_9/T/graphviz.rb20180924-74351-8tovlm: syntax error in line 2 near '\'

    from /Users/jroth/.rvm/gems/ruby-2.4.3/gems/ruby-graphviz-1.2.3/lib/graphviz/utils.rb:61:in `output_from_command'
    from /Users/jroth/.rvm/gems/ruby-2.4.3/gems/ruby-graphviz-1.2.3/lib/graphviz.rb:600:in `output'
    from (irb):4
    from /Users/jroth/.rvm/rubies/ruby-2.4.3/bin/irb:11:in `<main>'