Skip to content

passthrough: Inconsistent parsing #4

@jmooring

Description

@jmooring

This test passes:

func TestExample27(t *testing.T) {
	input := `Block $$a^*=x-b^*$$ equation

Inline $a^*=x-b^*$ equation`
	expected := `<p>Block </p>
$$a^*=x-b^*$$
<p> equation</p>
<p>Inline $a^*=x-b^*$ equation</p>`
	actual := Parse(t, input)

	c := qt.New(t)
	c.Assert(actual, qt.Equals, expected)
}

This test fails:

func TestExample28(t *testing.T) {
	input := `Inline $a^*=x-b^*$ equation

Block $$a^*=x-b^*$$ equation`
	expected := `<p>Inline $a^*=x-b^*$ equation</p>
<p>Block </p>
$$a^*=x-b^*$$
<p> equation</p>`
	actual := Parse(t, input)

	c := qt.New(t)
	c.Assert(actual, qt.Equals, expected)
}

test output

got:
  "<p>Inline $a^*=x-b^*$ equation</p>\n<p>Block $$a^*=x-b^*$$ equation</p>"
want:
  "<p>Inline $a^*=x-b^*$ equation</p>\n<p>Block </p>\n$$a^*=x-b^*$$\n<p> equation</p>"

The only difference between the two tests is the order in which the paragraphs are placed.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions