fix(hashline-edit): tolerate >>> prefix and spaces around # in line refs
This commit is contained in:
@@ -74,6 +74,28 @@ describe("parseLineRef", () => {
|
||||
//#then
|
||||
expect(result).toEqual({ line: 42, hash: "VK" })
|
||||
})
|
||||
|
||||
it("accepts refs copied with >>> marker only", () => {
|
||||
//#given
|
||||
const ref = ">>> 42#VK"
|
||||
|
||||
//#when
|
||||
const result = parseLineRef(ref)
|
||||
|
||||
//#then
|
||||
expect(result).toEqual({ line: 42, hash: "VK" })
|
||||
})
|
||||
|
||||
it("accepts refs with spaces around hash separator", () => {
|
||||
//#given
|
||||
const ref = "42 # VK"
|
||||
|
||||
//#when
|
||||
const result = parseLineRef(ref)
|
||||
|
||||
//#then
|
||||
expect(result).toEqual({ line: 42, hash: "VK" })
|
||||
})
|
||||
})
|
||||
|
||||
describe("validateLineRef", () => {
|
||||
|
||||
Reference in New Issue
Block a user