mushanshitiancai / vscode-paste-image

paste image from clipboard to markdown/asciidoc directly!
MIT License
422 stars 127 forks source link

Plain text for pasteImage.defaultName #60

Closed gandalfsaxe closed 4 years ago

gandalfsaxe commented 4 years ago

Hey,

Thanks for making the extension. I'd like the pastes images to be named image-YMMDDHHmmSSSSS, but this is seemingly currently not possible since the whole string is formatted according to https://momentjs.com/docs/#/displaying/format/ but the first part just plain text. Is this currently impossible?

If so could we add defaultNamePrefix and defaultNameSuffix? These would be the filename equivalent to the pasteImage.prefix and pasteImage.suffix we already have for the path.

gandalfsaxe commented 4 years ago

Ah never mind, it can easily be escaped with sqaure brackets 👍 From the same section in the documentation above:

escaping characters

To escape characters in format strings, you can wrap the characters in square brackets.

moment().format('[today] dddd'); // 'today Sunday'

Closing issue.