moodymudskipper / flow

View and Browse Code Using Flow Diagrams
https://moodymudskipper.github.io/flow/
Other
395 stars 26 forks source link

some characters in special comments make flow_view fail #57

Closed moodymudskipper closed 3 years ago

moodymudskipper commented 3 years ago
works <- function() {
  ## comment
  foo
}

fails <- function() {
  ## comment[
  foo
}
flow::flow_view(works, prefix = "##")

flow::flow_view(fails, prefix = "##")

Created on 2020-09-29 by the reprex package (v0.3.0)

moodymudskipper commented 3 years ago

data$nodes$label wasn't escaped in build_nomnoml_code().

moodymudskipper commented 3 years ago

additionally :

works <- function() {
  ## comment
  "foo[]"
  foo[]
}

fails <- function() {
  ## "comment"
  foo
}
flow_data(works, prefix = "##")
flow_data(fails, prefix = "##")
moodymudskipper commented 3 years ago

had to escape " in add_comment_calls

moodymudskipper commented 3 years ago

another weird issue in regular comments :

works <-
  function() {
    if(cond1) {
      # ,
      if(cond2) {
        foo
      }
    }
  }

fails1 <-
  function() {
    if(cond1) {
      # ,
      # com
      if(cond2) {
        foo
      }
    }
  }

fails2 <-
  function() {
    if(cond1) {
      # ,
      ## com
      if(cond2) {
        foo
      }
    }
  }

flow_data(works, prefix = "##")
flow_data(fails1, prefix = "##")
flow_data(fails2, prefix = "##")
moodymudskipper commented 3 years ago

seems to be solved by other fixes, I see nothing wrong with current local version

github-actions[bot] commented 2 years ago

This old thread has been automatically locked. If you think you have found something related to this, please open a new issue and link to this old issue if necessary.