Skip to content

Commit

Permalink
5.0.2 (#28)
Browse files Browse the repository at this point in the history
* Fixed bug whereby spaces in URL for local download were not being parsed correctly.
* Added replacement of linebreaks in image alt text with space.
* Fixed line break replacement to only apply to alt text.
  • Loading branch information
jglev authored Apr 16, 2023
1 parent a6589ea commit ddef35f
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 4 deletions.
7 changes: 6 additions & 1 deletion main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -357,7 +357,7 @@ export default class PastetoIndentationPlugin extends Plugin {
// file:
// !new RegExp("^([a-zA-Z])+://").test(src);
if (srcIsLocalFile) {
let urlForDownloading = src.replace(/^file:\/{2}/, "");
let urlForDownloading = decodeURI(src).replace(/^file:\/{2}/, "");

if (/^\/[A-Za-z]:/.test(urlForDownloading)) {
// We are likely in Windows, and need to remove an additional
Expand Down Expand Up @@ -405,6 +405,11 @@ export default class PastetoIndentationPlugin extends Plugin {
"src",
encodeURI(tfileObject.path)
);

srcContainingElements[i].setAttr(
"alt",
srcContainingElements[i].getAttr('src').replaceAll('\n', ' ')
)
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion manifest.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"id": "obsidian-paste-to-current-indentation",
"name": "Paste Mode",
"version": "5.0.1",
"version": "5.0.2",
"minAppVersion": "1.1.1",
"description": "Paste content and mark block quotes at any level of indentation.",
"author": "Jacob Levernier",
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "obsidian-paste-to-current-indentation",
"version": "5.0.1",
"version": "5.0.2",
"description": "This plugin allows pasting and marking text as block-quotes at any level of indentation.",
"main": "main.js",
"scripts": {
Expand Down
3 changes: 2 additions & 1 deletion versions.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,6 @@
"3.1.0": "0.14.6",
"4.0.0": "0.14.6",
"5.0.0": "1.0.0",
"5.0.1": "1.1.1"
"5.0.1": "1.1.1",
"5.0.2": "1.1.1"
}

0 comments on commit ddef35f

Please sign in to comment.