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

Styling Code Snippets & Command Output #333

Open
nitek29 opened this issue Jul 11, 2022 · 10 comments
Open

Styling Code Snippets & Command Output #333

nitek29 opened this issue Jul 11, 2022 · 10 comments

Comments

@nitek29
Copy link

nitek29 commented Jul 11, 2022

Hey,

It will be great if we can somehow mark/style parts of text in a command output or source snippet so they can stand out. Ideally, we can either bold them, change their color, or distinguish them in another way.
The problem is that it is not possible to format the text in the code and code block styles in the UI. For example, highlighting the vulnerable header in an HTTP request.
It's not a question of style functionnality in the .docx template.
Whatever is easier to implement, I am sure we can get it to work.

Thanks!

@yeln4ts
Copy link
Contributor

yeln4ts commented Jul 19, 2022

This is because code blocks in the application will result in a specific style in Word document. It would be possible to add syntax highlighting in the application but it won't be added in the generated report. So to be coherent between both the application and the report it was not added.

@nitek29
Copy link
Author

nitek29 commented Jul 21, 2022

Thank for your reply.
In this case, is it not possible to update the style in Word document too ?

@yeln4ts
Copy link
Contributor

yeln4ts commented Aug 1, 2022

I did not find a way to do that easily. Also the fact that the application is common to everyone and the Word document is specific to everyone makes it too complex to maintain consistency across everyone

@mrnfrancesco
Copy link

mrnfrancesco commented Aug 4, 2022

Hi @yeln4ts,
I get your point on adding code styling in pwndoc and using the document's styles is a good idea.
Unfortunately it is not supported by google docs (it natively supports just normal text and headings from h1 to h6).
This lead to code not be styled at all.

Considering the widespread of using google services, is there any chance you can reconsider the option to add some sort of styling directly in the app?

Even something default like Consolas font, white text, black background should be fine.
In this way who use word and the defined code style will continue to see the code using the defined style, who do not use word will see something that at least looks like code instead of normal text.

@yeln4ts
Copy link
Contributor

yeln4ts commented Aug 9, 2022

There already is a style in the application for code blocks and code.
image

@mrnfrancesco
Copy link

Yeah, sure.
Unfortunately those two apply a style in the docx based on a style. In case you use Google docs such style doesn't exists and the code is just formatted as normal text.

@yeln4ts
Copy link
Contributor

yeln4ts commented Aug 9, 2022

I don't think there is any solution to your issue then if Google docs does not apply styles.

@nitek29
Copy link
Author

nitek29 commented Sep 2, 2022

@mrnfrancesco Use table or paragraph with border instead of the codeblock style can be a solution. What do you thing about that ?

@mrnfrancesco
Copy link

Using a table/paragraph with borders make easier to isolate the code to the other text, but it still need at least a monospace font to render correctly.

For me the correct solution to match everyone needs is to use syntax highlight or any other code formatting directly as HTML in the app without using a document style. Basically the same that happens when you copy/paste code from VSCode into Word.

@nitek29
Copy link
Author

nitek29 commented Dec 1, 2022

FYI #355

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

3 participants