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

XML Parsing Error: duplicate attribute #59

Closed
yvt opened this issue Jul 26, 2020 · 0 comments
Closed

XML Parsing Error: duplicate attribute #59

yvt opened this issue Jul 26, 2020 · 0 comments

Comments

@yvt
Copy link

yvt commented Jul 26, 2020

The generated SVG file includes a duplicate attribute. When the file is opened directly, Firefox refuses to display it with the following message:

Screen Shot 2020-07-26 at 12 18 17

Input (it's from #58):

.-------.
| Hello |
'-------'
    |
    v
.-------.
| World |
'-------'

Output (excerpt):

<line x1="36" y1="48" x2="36" y2="80" class="solid" class="end_marked_arrow"></line>
Output (unabridged):
<svg xmlns="http://www.w3.org/2000/svg" width="80" height="144">
    <style>line, path, circle,rect,polygon {
                          stroke: black;
                          stroke-width: 2;
                          stroke-opacity: 1;
                          fill-opacity: 1;
                          stroke-linecap: round;
                          stroke-linejoin: miter;
                        }

                    text {
                        fill: black;
                        }
                        rect.backdrop{
                            stroke: none;
                            fill: white;
                        }
                        .broken{
                            stroke-dasharray: 8;
                        }
                        .filled{
                            fill: black;
                        }
                        .bg_filled{
                            fill: white;
                        }
                        .nofill{
                            fill: white;
                        }

                        text {
                         font-family: monospace;
                         font-size: 14px;
                        }

                        .end_marked_arrow{
                            marker-end: url(#arrow);
                         }
                        .start_marked_arrow{
                            marker-start: url(#arrow);
                         }

                        .end_marked_diamond{
                            marker-end: url(#diamond);
                         }
                        .start_marked_diamond{
                            marker-start: url(#diamond);
                         }

                        .end_marked_circle{
                            marker-end: url(#circle);
                         }
                        .start_marked_circle{
                            marker-start: url(#circle);
                         }

                        .end_marked_open_circle{
                            marker-end: url(#open_circle);
                         }
                        .start_marked_open_circle{
                            marker-start: url(#open_circle);
                         }

                        .end_marked_big_open_circle{
                            marker-end: url(#big_open_circle);
                         }
                        .start_marked_big_open_circle{
                            marker-start: url(#big_open_circle);
                         }

                         
                        </style>
    <defs>
        <marker id="arrow" viewBox="-2 -2 8 8" refX="4" refY="2" markerWidth="7" markerHeight="7" orient="auto-start-reverse">
            <polygon points="0,0 0,4 4,2 0,0"></polygon>
        </marker>
        <marker id="diamond" viewBox="-2 -2 8 8" refX="4" refY="2" markerWidth="7" markerHeight="7" orient="auto-start-reverse">
            <polygon points="0,2 2,0 4,2 2,4 0,2"></polygon>
        </marker>
        <marker id="circle" viewBox="0 0 8 8" refX="4" refY="4" markerWidth="7" markerHeight="7" orient="auto-start-reverse">
            <circle cx="4" cy="4" r="2" class="filled"></circle>
        </marker>
        <marker id="open_circle" viewBox="0 0 8 8" refX="4" refY="4" markerWidth="7" markerHeight="7" orient="auto-start-reverse">
            <circle cx="4" cy="4" r="2" class="bg_filled"></circle>
        </marker>
        <marker id="big_open_circle" viewBox="0 0 8 8" refX="4" refY="4" markerWidth="7" markerHeight="7" orient="auto-start-reverse">
            <circle cx="4" cy="4" r="3" class="bg_filled"></circle>
        </marker>
    </defs>
    <rect class="backdrop" x="0" y="0" width="80" height="144"></rect>
    <rect x="4" y="8" width="64" height="32" class="solid nofill" rx="4"></rect>
    <text x="18" y="28" class="">Hello</text>
    <rect x="4" y="88" width="64" height="32" class="solid nofill" rx="4"></rect>
    <text x="18" y="108" class="">World</text>
    <line x1="36" y1="48" x2="36" y2="80" class="solid" class="end_marked_arrow"></line>
</svg>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants