Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support line wrap or fixed width in generated code snippet string #334

Open
muhanlicircle opened this issue Jan 2, 2024 · 0 comments
Open

Comments

@muhanlicircle
Copy link

Hi, is there any plans to support a fixed width or line break for the generated string from HTTPSnippet.convert?

While generating the string, in certain use cases, the output string could be quite long for some lines, and seems like there is no options to have line break or line wrap.

For example, the following code snippet would be hard to view since it takes too much horizontal width (the url field):

import axios from 'axios';

const options = {
  method: 'POST',
  url: 'https://url.com/this_is_a_super_long_url_this_is_a_super_long_url_this_is_a_super_long_url_this_is_a_super_long_url_'
};

try {
  const { data } = await axios.request(options);
  console.log(data);
} catch (error) {
  console.error(error);
}

If we could possibly add a line break (boolean, or width as a number) as an option:

import axios from 'axios';

const options = {
  method: 'POST',
  url: 'https://url.com/this_is_a_super_long_url
       _this_is_a_super_long_url_this_is_a_sup
       er_long_url_this_is_a_super_long_url_'
};

try {
  const { data } = await axios.request(options);
  console.log(data);
} catch (error) {
  console.error(error);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant