Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

support multi-line image urls #103

Closed
richardwthompson opened this issue Dec 26, 2015 · 2 comments
Closed

support multi-line image urls #103

richardwthompson opened this issue Dec 26, 2015 · 2 comments

Comments

@richardwthompson
Copy link

I have been using Gravizo (http://gravizo.com/) in my markdown documents to allow me to incorporate diagrams.

This works great when I actually generate the html files from my markdown docs.

The only down side is that the multimarkdown preview doesn't support this ... which I assume is down to the image url being split over multiple lines.

Is there any way that the multimarkdown preview functionality could be updated to support / render multi-line image urls?

E.g. the following works when I generate the full html file ... but it doesn't work with multimarkdown preview

 ![Alt text](http://g.gravizo.com/g?
  digraph G {
    aize ="4,4";
    main [shape=box];
    main -> parse [weight=8];
    parse -> execute;
    main -> init [style=dotted];
    main -> cleanup;
    execute -> { make_string; printf}
    init -> make_string;
    edge [color=red];
    main -> printf [style=bold,label="100 times"];
    make_string [label="make a string"];
    node [shape=box,style=filled,color=".7 .3 1.0"];
    execute -> compare;
  }
)

![Alt text](http://g.gravizo.com/g?
digraph G {
aize ="4,4";
main [shape=box];
main -> parse [weight=8];
parse -> execute;
main -> init [style=dotted];
main -> cleanup;
execute -> { make_string; printf}
init -> make_string;
edge [color=red];
main -> printf [style=bold,label="100 times"];
make_string [label="make a string"];
node [shape=box,style=filled,color=".7 .3 1.0"];
execute -> compare;
})

@vsch vsch added this to the Version 1.4.0 milestone Dec 26, 2015
@vsch vsch added the duplicate label Dec 26, 2015
@vsch
Copy link
Owner

vsch commented Dec 26, 2015

@richardwthompson, yes pegdown does not handle multi-line urls. I am planning to address this but it goes into the guts of its processing and I did not plan on doing this until later.

The only workaround is to use the HTML img tag, but then GitHub will not process it so it will only work for in-plugin viewing.

<img src='http://g.gravizo.com/g?
  digraph G {
    aize ="4,4";
    main [shape=box];
    main -> parse [weight=8];
    parse -> execute;
    main -> init [style=dotted];
    main -> cleanup;
    execute -> { make_string; printf}
    init -> make_string;
    edge [color=red];
    main -> printf [style=bold,label="100 times"];
    make_string [label="make a string"];
    node [shape=box,style=filled,color=".7 .3 1.0"];
    execute -> compare;
  }
'>

I will put this on a higher priority and try to get it into the plugin for next release, milestone Version 1.4.0 slated for Jan 25th release.

It is something that was asked by another user in #4 and I thought that using img html tag was a workaround but when checked it against GitHub realized it does not work.

@vsch
Copy link
Owner

vsch commented Jan 3, 2016

@richardwthompson, I have some good news for you and some great news!

I hacked multi-line URL images into pegdown and added a cherry on top by adding language injections into the multi-line content.

gravizo

gravizo2

I will be finalizing the release tomorrow, so this feature will be in it.

Customizations for how the text-fragment is converted during fragment editing will be added in the next version. For now removing and adding ; at end of line is hardcoded if the URL starts with "http://g.gravizo.com/g?".

You can even preview with "PlantUML integration" plugin.

gravizo3

Hope you like it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants