feat: some stuff?
All checks were successful
Build and Push Server / build-and-push (push) Successful in 4m19s
All checks were successful
Build and Push Server / build-and-push (push) Successful in 4m19s
This commit is contained in:
@@ -3,6 +3,7 @@ package matcher
|
||||
|
||||
import (
|
||||
"math"
|
||||
"strings"
|
||||
|
||||
"git.max-richter.dev/max/marka/parser/utils"
|
||||
"git.max-richter.dev/max/marka/template"
|
||||
@@ -20,7 +21,7 @@ func (m Block) GetContent() string {
|
||||
if m.src == nil || m.Start < 0 || m.End > len(*m.src) || m.Start > m.End {
|
||||
return ""
|
||||
}
|
||||
return (*m.src)[m.Start:m.End]
|
||||
return strings.TrimSpace((*m.src)[m.Start:m.End])
|
||||
}
|
||||
|
||||
// MatchBlocksFuzzy finds anchor positions for all BlockMatching blocks using
|
||||
|
||||
@@ -72,7 +72,7 @@ func TestMatch_FuzzyBlockBaguette(t *testing.T) {
|
||||
value: "- Flour\n- Water\n- Salt",
|
||||
},
|
||||
{
|
||||
value: "1. Mix Flour Water and Salt\n2. Bake the bread\n",
|
||||
value: "1. Mix Flour Water and Salt\n2. Bake the bread",
|
||||
},
|
||||
}
|
||||
|
||||
@@ -118,7 +118,7 @@ func TestMatch_FuzzyBlockSalad(t *testing.T) {
|
||||
value: "- 100 g lettuce\n- 5 cherry tomatoes\n- 1 tbsp olive oil\n- Pinch of salt",
|
||||
},
|
||||
{
|
||||
value: "1. Wash and dry the lettuce.\n2. Halve the cherry tomatoes.\n3. Toss with olive oil and salt.\n",
|
||||
value: "1. Wash and dry the lettuce.\n2. Halve the cherry tomatoes.\n3. Toss with olive oil and salt.",
|
||||
},
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user