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

Markdown support #105

Closed
noraj opened this issue Mar 23, 2021 · 9 comments
Closed

Markdown support #105

noraj opened this issue Mar 23, 2021 · 9 comments

Comments

@noraj
Copy link
Contributor

noraj commented Mar 23, 2021

It would be nice to have alternative Markdown support for findings fields rather than HTML. Using HTML or Markdown could be set up globally in the admin area.

Example of similar tool that has Markdown support: writehat

@yeln4ts
Copy link
Contributor

yeln4ts commented Mar 24, 2021

The text has to be saved in HTML format so that it can be converted to OOXML when generating. Also not everything can be converted to OOXML right now (eg: tables). I don't see the necessity to handle both format when writing.
The only thing that I thought would be useful would be to have the option to convert some selected text from Markdown to HTML for people who take their notes in Markdown.

@noraj
Copy link
Contributor Author

noraj commented Mar 31, 2021

Markdown if meant to be transpilled as HTML and markdown renderers can accepts html tags and forwards them so sotring markdown would be backward compatible with vulns storing HTML. Generating the report would be Markdown -> HTML -> OOXML then. So in fact we can keep markdown only while being backward compatible.

As most pentesters use markdown, that github issues/comment are using markdown, HackerOne issue are using markdown, etc. having markdown here would facilitate a lot.

@yeln4ts yeln4ts closed this as completed Jun 17, 2022
@noraj
Copy link
Contributor Author

noraj commented Jun 18, 2022

I take this as a "No" then 😆

@yeln4ts
Copy link
Contributor

yeln4ts commented Jun 21, 2022

Yes sorry I didn't want to focus too much on this point since editing is already working good with HTML.

Since I could sense your disappointment 😛 I looked at it by curiosity with a fresh eye and I had disabled Input and Paste rules of the editor because of some markdown issues (I don't remember what). But since then I added some checks that could have resolved those issues. I did a quick test and it seems to be working correctly.

Can you check on your side (or anyone who would like to test for markdown) by commenting those 2 lines in frontend/src/components/editor.vue:
image

This will enable markdown only for handled items (the ones in the toolbar). If it works correctly I could reopen this issue as an enhancement and will add it in the User settings feature (which is not yet implemented)

@noraj
Copy link
Contributor Author

noraj commented Jun 22, 2022

This will enable markdown only for handled items (the ones in the toolbar).

ON PASTE It works only for bold, Strikethrough, italic and inline code. It doesn't work for lists, titles, code blocks, quotes even if they are on the toolbar.

When writing Everything in the toolbar works. Links are missing from the toolbar and so are not working.

I don't like much the render in place, is there an option to show the source (both for HTML or markdown)?

I also found some examples of Markdown editor with vue:

@yeln4ts
Copy link
Contributor

yeln4ts commented Jun 22, 2022

Yes it seems there are some limitations when pasting when going through the tiptap issues.

As I find that it's working correctly using HTML and I like the customizability of tiptap I wont change the editor.

Feel free to explore tiptap customization capabilities and if you find a way to make it work flawlessly I will gladly add it to the project.

@noraj
Copy link
Contributor Author

noraj commented Jun 22, 2022

Even for HTML could you enable the link shortcut on the editor.

@yeln4ts
Copy link
Contributor

yeln4ts commented Jun 22, 2022

Not yet as it should also be handled in the OOXML conversion.
The goal is that anything you have in the editor you can find it in your generated report.
I am currently reviewing a PR that handle links as a filter. If it works then it could be use in the HTML to OOXML function

@CarlesLlobet
Copy link

I'd love to have this feature too.

I (and I am sure many other folks around here) tend to work in Markdown (in either Outline/Notion/Sublime) due to many reasons:

  • Ease of use: I find it easier and much more straightforward to document whilst I'm in the middle of an engagement
  • Offline: sometimes I write/fine-tune my findings whilst traveling or offline, so it's straightforward to do so in markdown
  • Compatibility: Although for clients it's great to have a report in doc/pdf, keeping the notes in Markdown format allows you simply paste the Markdown directly when its for a BugBounty / Github Issue, etc.

In my scenario, I wouldn't need the pwndoc itself to support markdown editing, but at least it'd be awesome to be able to copy a whole markdown (with all findings/evidence images/etc) and that it parsed all content (provided a specific format, ofc) to directly import to your pwndoc DB and generate a report.

Would something like this ("Import Markdown") be easier to implement than rather full markdown support which implies an editor change?

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