Skip to content

Commit f4e2b3c

Browse files
committed
Release 0.0.12
1 parent c8f84cb commit f4e2b3c

File tree

4 files changed

+13
-17
lines changed

4 files changed

+13
-17
lines changed

manifest.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"id": "obsidian-read-it-later",
33
"name": "ReadItLater",
4-
"version": "0.0.11",
4+
"version": "0.0.12",
55
"minAppVersion": "0.9.12",
66
"description": "Saves the clipboard to a new notice.",
77
"author": "Dominik Pieper",

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "obsidian-sample-plugin",
3-
"version": "0.0.11",
3+
"version": "0.0.12",
44
"description": "This is a sample plugin for Obsidian (https://obsidian.md)",
55
"main": "main.js",
66
"scripts": {

src/helpers/replaceImages.ts

Lines changed: 10 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,13 @@
1-
import { App, DataAdapter } from "obsidian";
2-
import { basename } from "path";
3-
import { isValidUrl, normalizeFilename, pathJoin } from ".";
4-
import { checkAndCreateFolder } from "./checkAndCreateFolder";
5-
import { downloadImage } from "./downloadImage";
6-
import { linkHashes } from "./linkHash";
1+
import { App, DataAdapter } from 'obsidian';
2+
import { basename } from 'path';
3+
import { isValidUrl, normalizeFilename, pathJoin } from './fileutils';
4+
import { checkAndCreateFolder } from './checkAndCreateFolder';
5+
import { downloadImage } from './downloadImage';
6+
import { linkHashes } from './linkHash';
77

88
export const EXTERNAL_MEDIA_LINK_PATTERN = /\!\[(?<anchor>.*?)\]\((?<link>.+?)\)/g;
99
export async function replaceImages(app: App, content: string, assetsDir: string) {
10-
return await replaceAsync(
11-
content,
12-
EXTERNAL_MEDIA_LINK_PATTERN,
13-
imageTagProcessor(app, assetsDir),
14-
);
10+
return await replaceAsync(content, EXTERNAL_MEDIA_LINK_PATTERN, imageTagProcessor(app, assetsDir));
1511
}
1612

1713
export function replaceAsync(string: string, searchValue: string | RegExp, replacer: any) {
@@ -58,7 +54,7 @@ export function imageTagProcessor(app: App, mediaDir: string) {
5854
anchor,
5955
link,
6056
fileContent,
61-
fileExtension
57+
fileExtension,
6258
);
6359

6460
if (needWrite && fileName) {
@@ -87,7 +83,6 @@ export function imageTagProcessor(app: App, mediaDir: string) {
8783
};
8884
}
8985

90-
9186
export const FORBIDDEN_SYMBOLS_FILENAME_PATTERN = /\s+/g;
9287

9388
export const FILENAME_TEMPLATE = 'media';
@@ -99,7 +94,7 @@ async function chooseFileName(
9994
baseName: string,
10095
link: string,
10196
contentData: ArrayBuffer,
102-
fileExtension: string | false
97+
fileExtension: string | false,
10398
): Promise<{ fileName: string; needWrite: boolean }> {
10499
if (!fileExtension) {
105100
return { fileName: '', needWrite: false };
@@ -152,4 +147,4 @@ async function chooseFileName(
152147
linkHashes.ensureHashGenerated(link, contentData);
153148

154149
return { fileName, needWrite };
155-
}
150+
}

versions.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
{
2+
"0.0.12": "0.9.12",
23
"0.0.11": "0.9.12",
34
"0.0.10": "0.9.12",
45
"0.0.9": "0.9.12",

0 commit comments

Comments
 (0)