Skip to content

[html] Format onPaste issues with HTML #21218

Closed

Description

  • VSCode Version: Code 1.9.1 (f9d0c68, 2017-02-09T00:26:45.394Z)
  • OS Version: Windows_NT ia32 10.0.14393

Steps to Reproduce:

  1. Create an HTML document like below
    image

  2. Copy the nested-content div
    image

  3. Since we copied the spacing on the left (along with the text), we should be able to place our cursor to the very left and paste (or even just paste). Instead of the correct formatting we get something like this:
    image

    or this (without moving the text cursor)
    image

I assume this is an issue with the newer format feature, but I could be wrong.

Activity

  1. warpdesign commented on Mar 4, 2017

    @warpdesign
    Contributor

    I'm not sure this should go there but one nice thing I noticed about Java IDE is the fact that when pasting text inside a string, the pasted string is escaped if necessary.

    So, pasting I'm doing well here:

    let message = 'paste here: ';
    

    would result in:

    let message = 'paste here: I\'m doing well';
    
  2. kzhui125 commented on Mar 8, 2017

    @kzhui125

    I have an issue with formatOnPaste:
    copy the following code into <script></script> with "editor.formatOnPaste": true, it looks not good
    (function() {
    var updateButton = document.getElementById('updateDetails');
    var cancelButton = document.getElementById('cancel');
    var favDialog = document.getElementById('favDialog');

    // Update button opens a modal dialog
    updateButton.addEventListener('click', function() {
    favDialog.showModal();
    });

    // Form cancel button closes the dialog box
    cancelButton.addEventListener('click', function() {
    favDialog.close();
    });
    })();

    1

  3. added
    html
    bug
    on Apr 5, 2017
  4. changed the title [-]Format onPaste issues with HTML[/-] [+][html] Format onPaste issues with HTML[/+] on Apr 12, 2017
  5. removed their assignment
    on Apr 12, 2017
  6. locked and limited conversation to collaborators on Nov 18, 2017
  7. added a commit that references this issue on Sep 6, 2026
    7e1c488
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

bughtmlverified

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions