Skip to content

Line break (\n) as delimiter #160

Description

@eav93

Hello, I want set \n as delimiter, but you remove this elements on "normalize".

Activity

  1. yairEO commented on Dec 8, 2018

    @yairEO
    Owner

    Why would you want tags to be in a vertical list layout instead of horizontal "bricks" layout?

  2. eav93 commented on Dec 8, 2018

    @eav93
    Author

    i want divide text with /n on paste, to horizontal tags list.

  3. yairEO commented on Dec 8, 2018

    @yairEO
    Owner

    I was thinking about this for the past 2 hours and I really don't have a good solution.

    The \s regex in normalize is intended to cleanup any new lines, tabs and spaces.
    These things are 99% of the time more unwanted than wanted (like in your case) so, removing this cleanup process will cause, in my opinion, more harm than good.

    Why are you pasting a string which has new lines? this should be corrected at the source if possible, or at maybe replace the delimiter to a comma or something.

  4. added a commit that references this issue on Feb 19, 2019
    ebf9508
  5. yairEO commented on Feb 19, 2019

    @yairEO
    Owner

    Fixed. Now you can input things such as:

    aaa
    bbb
    ccc
    

    The way it works is by doing this trick:

    replace(/(?:\r\n|\r|\n)/g, this.settings.delimiters.source.charAt(1))
    

    which replaces new lines with the first delimiter specified (if one was specified)

  6. eav93 commented on Jun 29, 2019

    @eav93
    Author

    Now, delimiters are regular expressions. When I set
    {delimiters: ',|;'}
    this.settings.delimiters.source.charAt(1)=='|'

  7. changed the title [-]Line break (\n) as delimetr[/-] [+]Line break (\n) as delimiter[/+] on Nov 28, 2019
  8. yairEO commented on Aug 5, 2020

    @yairEO
    Owner

    To have multi-line pasted text become multiple tags, the delimiters setting should be as follows:

    delimiters: ",|\n|\r"
    

    It's imperative to use both \n & \r

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions