drafter icon indicating copy to clipboard operation
drafter copied to clipboard

Support tabs and CRLF line endings

Open abtris opened this issue 11 years ago • 23 comments

@zdne opened apiaryio/snowcrash#29

abtris avatar Aug 30 '13 07:08 abtris

@netmilk commented

+1 Apiary users are often facing this issue:

message: Cannot parse blueprint code 
description: The use of tab(s) '\\t' in source data isn't currently 
supported, please contact makers 
code: 2

abtris avatar Oct 24 '13 13:10 abtris

@zzen commented

+1

abtris avatar Nov 02 '13 06:11 abtris

@zdne commented

To fix this issues a moderate modification to https://github.com/apiaryio/sundown is needed.

Consider using Hoedown contributing to hoedown/hoedown#22 and hoedown/hoedown#28 instead

abtris avatar Nov 13 '13 22:11 abtris

@pksunkara commented

Can we make a hack for this by expanding all \t before parsing?

abtris avatar Sep 24 '14 10:09 abtris

@zdne commented

This won't not help as then you would need to recalculate the source maps (in order to display any possible warning / errors). Doing so (recalculating) is the core problem here and solving it would bring the solution for this issue (and thus it wouldn't be a hack)

abtris avatar Sep 26 '14 12:09 abtris

@ze-phyr-us commented

+1 for tabs! Any ETA on this?

abtris avatar Apr 25 '15 02:04 abtris

@zdne commented

@ze-phyr-us so far there wasn't too much of push on this one (read no concrete plans yet). Introducing this will most likely mean migration to Hoedown or CommonMark parser.

abtris avatar Apr 27 '15 02:04 abtris

@defaltd commented

Pinging for update @zdne

abtris avatar Jan 13 '16 17:01 abtris

@zdne commented

Hey @Stephn-R,
you are the first one to ask for this in a long time. I am afraid the status hasn't changed since https://github.com/apiaryio/snowcrash/issues/29#issuecomment-96465592 we might migrate the parser but no ETA just yet.

abtris avatar Jan 14 '16 13:01 abtris

@defaltd commented

So lets rise this baby back from the dead :skull: :zap:

abtris avatar Jan 14 '16 16:01 abtris

@jacquesfu commented

So what's a workaround? I have codeblocks with tabs to show examples... will the codeblocks have to be converted to spaces I guess?

abtris avatar Jan 25 '16 03:01 abtris

@ze-phyr-us commented

@jacquesfu I'm just piping my blueprints through sed 's/ / /g' before feeding them to snowcrash.

Edit: GH screws up the formatting, but obviously that was s/<tab>/<4 spaces>/g

abtris avatar Jan 25 '16 03:01 abtris

@zdne commented

Hey guys, may I just ask you where you need the tabs? Is it the mock server or testing? I presume it is really about the content of payloads and not necessarily the blueprint itself, correct?

abtris avatar Jan 26 '16 13:01 abtris

@defaltd commented

Alright so the way I was able to resolve this was if I targeted the affected files and ran a python method for stripping out carriage returns >> \r

abtris avatar Jan 26 '16 14:01 abtris

@ze-phyr-us commented

@zdne Coding standards. When the entire project uses tabs rather than spaces, I want my documentation consistent with that.

abtris avatar Jan 27 '16 03:01 abtris

@defaltd commented

Agreed but this discussion is about the way line endings are formed by your IDE/System

abtris avatar Jan 27 '16 04:01 abtris

@lippea commented

This is not big problem, but quite annoying. We also have problem that I removed all \t \r, committed to git, but others still have problem with \r after downloading the code again.

abtris avatar Mar 09 '16 23:03 abtris

@BigBlueHat commented

I just hit this issue because Windows. :confounded: It's obviously possible to route around, but it's an unfortunate complication when trying to use API Blueprint docs with dredd, etc.

Remove pain. Win hearts and minds. :smile:

:+1: to fixing this soon.

abtris avatar Aug 08 '16 20:08 abtris

@tobeorla commented

I hope CRLF gets supported or converted when necessary

abtris avatar Oct 06 '16 09:10 abtris

@jch254 commented

+1!!!

abtris avatar Nov 15 '16 01:11 abtris

@honzajavorek commented

This is an important pre-requisite for https://github.com/apiaryio/dredd/issues/204.

abtris avatar Dec 02 '16 17:12 abtris

@vnenkpet commented

+1

abtris avatar Feb 01 '17 09:02 abtris

@lippea commented

It was annoying, but not blocking issue. I ended up by replacing with notepad++ and check into github with .gitattributes: *.apib text eol=lf

abtris avatar Mar 27 '17 23:03 abtris