connec/yaml-js

compose wrong end_mark on objects in seq

AlexHolly opened this issue · 1 comments

Example https://codepen.io/alexholly/pen/qBBjYJq

This shows in line 50 the end line 2 but it should be 1

key:
  - 1
test: 2

This case shows it right, in line 50 the end line is 1

key:
  - 1

In cases with Block Style Indicator '>' or '|' end_line has also a +1 bug

Is this a solution or why is this happening?

Add this to line

if(event.style=='>' || event.style=='|') {
  event.end_mark.line -= 1;
}

Test case:

key: >- 
 jhgjhgjhgkjhkjh
test: 1

Thanks for the issue, but I'm going to close it since this repository is going to be archived. yaml-js has been unmaintained for some time, so it would be best to use something else.