Skip to content

Error matching a v-for directive. #1

@lksnmnn

Description

@lksnmnn

Hey there,

thank you for this lexer.

I am currently writing my thesis and was looking for a way to make the Latex code listings look nice. I use the minted package which uses pygmentize itself. But so far, the output does not yet satisfy my requirements.

Here is an example code snippet, where the lexer falsely marks =" and " in the second v-for loop as an error.

<template>
    <svg viewBox="-200, -200, 400, 400">
        <g id="nodes">
            <circle 
                v-for="node in graph.nodes"
                :key="node.id"
                :x="node.x"
                :y="node.y"
                :r="getNodeRadius(node)"
            >
        </g>
        <g id="links">
            <line
                v-for="link in graph.links"
                :key="link.id"
                :x1="link.source.x"
                :x2="link.target.x"
                :y1="link.source.y"
                :y2="link.target.y"
                :style="getLinkStyle(link)"
            />
        </g>
    </svg>
</template>

👍 GitHubs Lexer does a good job ;)

The wrong output line looks like this:

<span class="na">v</span><span class="nt">-for</span><span class="err">=&quot;</span><span class="na">link</span> <span class="na">in</span> <span class="na">graph.links</span><span class="err">&quot;</span>

Bildschirmfoto 2019-10-19 um 12 29 03

I attached the full HTML output (as txt, Github doesnt support HTML 😩).
test.txt

Cheers,
Lukas

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions