documentation icon indicating copy to clipboard operation
documentation copied to clipboard

Why is the position being removed from remark output

Open koraa opened this issue 4 years ago • 4 comments

f4a46b134f58639f352b3024801c3d98f901d66a

src/remark-remove-position.js

Forgive me for putting this so bluntly, but…WHY? I was using documentation.js to parse documentation and extract code blocks for ferrum.doctest and my build is failing because of the removal of the position?

I am perfectly happy with the upgrade, but removing the position might better have been a breaking change oO

koraa avatar May 04 '21 16:05 koraa

(Anyway thanks for creating documentation.js I should add!!)

koraa avatar May 04 '21 16:05 koraa

You can see the recent PR that removed position in #1369. position information was bloating test fixtures (to the tune of 14k LoC) and didn't have any clear purpose in the output - apparently ferrum.doctest was using it, but it is fairly difficult as a maintainer of a large project with many users to anticipate all possible use cases.

Happy to accept a PR that would turn off position information for tests, to keep the simplification on that side, but include position information in the mdast output mode.

tmcw avatar May 04 '21 19:05 tmcw

I will make it optional that mean make it options which switch on and doesn't remove position Object. @tmcw I'll take it.

anthony-redFox avatar May 04 '21 19:05 anthony-redFox

I will make it optional that mean make it options which switch on and doesn't remove position Object. @tmcw I'll take it.

Thank you very much! :pray:

koraa avatar May 04 '21 20:05 koraa