Clicking on Quote in an issue comment, copies content with HTML tags (OD-1727)
Artur opened 2 years ago

This is on Brave browser (Chrome). When I click on "Quote" to copy comment content, it is copied but at also includes bunch of HTML tags, mostly div tags.

I think the quote should copy comment without any HTML tags.

  • Robin Shen commented 2 years ago

    This is on Brave browser (Chrome). When I click on "Quote" to copy comment content, it is copied but at also includes bunch of HTML tags, mostly div tags.

    I think the quote should copy comment without any HTML tags.

    This quote is added via Brave, and seems that it is correct.

  • Artur commented 2 years ago

    The original comment does not have any HTML tags, so you are saying that HTML tags in copied quote is a correct behavior?

  • Robin Shen commented 2 years ago

    It will copy the text as is.

  • Robin Shen changed state to 'Closed' 2 years ago
    Previous Value Current Value
    Open
    Closed
  • wojtek commented 2 years ago

    The original comment does not have any HTML tags, so you are saying that HTML tags in copied quote is a correct behavior?

    Sorry to side-quote -- have you checked the sources of the comment?

    I noticed that comments submitted by email quite often do have html for formatting and while it's not visible in rendered comment it is visible in quote.

    I mentioned it here: https://code.onedev.io/onedev/server/~issues/1923#IssueComment-7034

  • Robin Shen changed state to 'Open' 2 years ago
    Previous Value Current Value
    Closed
    Open
  • Robin Shen changed fields 2 years ago
    Name Previous Value Current Value
    Type
    Bug
    Question
  • Robin Shen commented 2 years ago

    It is very difficult or even impossible to convert html to markdown preserving format. So OneDev preserves html tags for comments received via email, and the quoted text will preserve that also for formatting purpose. It is just the source cluttered with html tags in this case, but the rendered result is fine. If you do not want to the source being cluttered with html tags in this case, just copy rendered text and put inside quote.

  • wojtek commented 2 years ago

    It is very difficult or even impossible to convert html to markdown preserving format.

    Would you consider it as an option in Mail Service? "Convert incoming email to markdown (with possible formatting loss)"? I'm aware that it's difficult and some things can't be converted but we mostly care about the information and basic formatting (bold, italics, maybe bullet points)… Maybe utilize library like flexmark-html2md-converter ?

    If you do not want to the source being cluttered with html tags in this case, just copy rendered text and put inside quote.

    #OD-1948 would help a lot with this one :-)

  • Robin Shen commented 2 years ago

    I'd argue that quoting contents from email rely is not a common case, and even for this case we have workarounds that copy/paste rendered text, and apply the quote (select text and click the quote icon). Adding extra options for this will result more and more options which may be difficult to understand and use.

  • Robin Shen commented 2 years ago

    And I agree that it will be much easier with OD-1948

  • Robin Shen changed state to 'Closed' 2 years ago
    Previous Value Current Value
    Open
    Closed
  • wojtek referenced from other issue 1 year ago
issue 1/1
Type
Question
Priority
Normal
Assignee
Labels
No labels
Issue Votes (0)
Watchers (4)
Reference
OD-1727
Please wait...
Connection lost or session expired, reload to recover
Page is in error, reload to recover