Skip to content

Commit

Permalink
Fix wikilinks spacing issue (#1719)
Browse files Browse the repository at this point in the history
  • Loading branch information
stevencohn authored Dec 23, 2024
1 parent 66993c8 commit 9ceca41
Show file tree
Hide file tree
Showing 14 changed files with 4 additions and 73 deletions.
7 changes: 0 additions & 7 deletions OneMore/Commands/File/ImportCommand.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ namespace River.OneMoreAddIn.Commands
using Windows.Data.Pdf;
using Windows.Storage;
using Windows.Storage.Streams;
using Resx = Properties.Resources;


/// <summary>
Expand Down Expand Up @@ -509,12 +508,6 @@ private async Task ImportPdfFile(string filepath, bool append, CancellationToken

private async Task ImportMarkdown(string filepath)
{
if (filepath.IndexOf(' ') >= 0)
{
ShowInfo(string.Format(Resx.ImportCommand_noSpaces, filepath));
return;
}

logger.StartClock();

if (!PathHelper.HasWildFileName(filepath))
Expand Down
5 changes: 4 additions & 1 deletion OneMore/Commands/File/Markdown/WikilinkRenderer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,10 @@ protected override void Write(HtmlRenderer renderer, WikilinkInline obj)
// : link;

var uri = new Uri(Path.Combine(renderer.BaseUrl.AbsolutePath, filename));
var src = uri.AbsoluteUri;

var src = uri.AbsoluteUri
// double-encoding might encode "%20" to "%2520" (%25 is "%")
.Replace("%2520", "%20");

renderer.Write($"<img src=\"{src}\" alt=\"{label}\" />");
Logger.Current.WriteLine($"wrender<img> src=[{src}] alt=[{label}]");
Expand Down
10 changes: 0 additions & 10 deletions OneMore/Properties/Resources.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 0 additions & 5 deletions OneMore/Properties/Resources.ar-SA.resx
Original file line number Diff line number Diff line change
Expand Up @@ -1534,11 +1534,6 @@
<value>عرض تغيير الحجم المفضل</value>
<comment>label</comment>
</data>
<data name="ImportCommand_noSpaces" xml:space="preserve">
<value>لا يمكن لـ OneNote استيراد ملفات تخفيض السعر من المسارات التي تحتوي على مسافات:
{0}</value>
<comment>error message</comment>
</data>
<data name="ImportDialog_fileLabel.Text" xml:space="preserve">
<value>ملف:</value>
<comment>label</comment>
Expand Down
5 changes: 0 additions & 5 deletions OneMore/Properties/Resources.de-DE.resx
Original file line number Diff line number Diff line change
Expand Up @@ -1534,11 +1534,6 @@ Gelber Hintergrund</value>
<value>Bevorzugte Größenänderungsbreite</value>
<comment>label</comment>
</data>
<data name="ImportCommand_noSpaces" xml:space="preserve">
<value>OneNote kann keine Markdown-Dateien aus Pfaden importieren, die Leerzeichen enthalten:
{0}</value>
<comment>error message</comment>
</data>
<data name="ImportDialog_fileLabel.Text" xml:space="preserve">
<value>Datei:</value>
<comment>label</comment>
Expand Down
5 changes: 0 additions & 5 deletions OneMore/Properties/Resources.es-ES.resx
Original file line number Diff line number Diff line change
Expand Up @@ -1534,11 +1534,6 @@ Fondo amarillo</value>
<value>Ancho de cambio de tamaño preferido</value>
<comment>label</comment>
</data>
<data name="ImportCommand_noSpaces" xml:space="preserve">
<value>OneNote no puede importar archivos de rebajas desde rutas que contengan espacios:
{0}</value>
<comment>error message</comment>
</data>
<data name="ImportDialog_fileLabel.Text" xml:space="preserve">
<value>Archivo:</value>
<comment>label</comment>
Expand Down
5 changes: 0 additions & 5 deletions OneMore/Properties/Resources.fr-FR.resx
Original file line number Diff line number Diff line change
Expand Up @@ -1534,11 +1534,6 @@ Fond jaune</value>
<value>Largeur de redimensionnement préférée</value>
<comment>label</comment>
</data>
<data name="ImportCommand_noSpaces" xml:space="preserve">
<value>OneNote ne peut pas importer de fichiers démarques à partir de chemins contenant des espaces :
{0}</value>
<comment>error message</comment>
</data>
<data name="ImportDialog_fileLabel.Text" xml:space="preserve">
<value>Fichier:</value>
<comment>label</comment>
Expand Down
5 changes: 0 additions & 5 deletions OneMore/Properties/Resources.he-IL.resx
Original file line number Diff line number Diff line change
Expand Up @@ -1535,11 +1535,6 @@ Total Row Font
<value>שינוי גודל רוחב מועדף</value>
<comment>label</comment>
</data>
<data name="ImportCommand_noSpaces" xml:space="preserve">
<value>ל-OneNote אין אפשרות לייבא קבצי סימון מנתיבים המכילים רווחים:
{0}</value>
<comment>error message</comment>
</data>
<data name="ImportDialog_fileLabel.Text" xml:space="preserve">
<value>קוֹבֶץ:</value>
<comment>label</comment>
Expand Down
5 changes: 0 additions & 5 deletions OneMore/Properties/Resources.ja-JP.resx
Original file line number Diff line number Diff line change
Expand Up @@ -1537,11 +1537,6 @@ OneNoteファイル (*.one)</value>
<value>標準サイズ幅</value>
<comment>label</comment>
</data>
<data name="ImportCommand_noSpaces" xml:space="preserve">
<value>OneNote は、スペースを含むパスからマークダウン ファイルをインポートできません。
{0}</value>
<comment>error message</comment>
</data>
<data name="ImportDialog_fileLabel.Text" xml:space="preserve">
<value>ファイル:</value>
<comment>label</comment>
Expand Down
5 changes: 0 additions & 5 deletions OneMore/Properties/Resources.nl-NL.resx
Original file line number Diff line number Diff line change
Expand Up @@ -1535,11 +1535,6 @@ Gele achtergrond</value>
<value>Voorkeur formaat wijzigen breedte</value>
<comment>label</comment>
</data>
<data name="ImportCommand_noSpaces" xml:space="preserve">
<value>OneNote kan geen markdown-bestanden importeren uit paden die spaties bevatten:
{0}</value>
<comment>error message</comment>
</data>
<data name="ImportDialog_fileLabel.Text" xml:space="preserve">
<value>Het dossier:</value>
<comment>label</comment>
Expand Down
5 changes: 0 additions & 5 deletions OneMore/Properties/Resources.pl-PL.resx
Original file line number Diff line number Diff line change
Expand Up @@ -1535,11 +1535,6 @@ Czerwony pierwszy plan
<value>Preferowana szerokość zmiany rozmiaru</value>
<comment>label</comment>
</data>
<data name="ImportCommand_noSpaces" xml:space="preserve">
<value>Program OneNote nie może importować plików przecen ze ścieżek zawierających spacje:
{0}</value>
<comment>error message</comment>
</data>
<data name="ImportDialog_fileLabel.Text" xml:space="preserve">
<value>Plik:</value>
<comment>label</comment>
Expand Down
5 changes: 0 additions & 5 deletions OneMore/Properties/Resources.pt-BR.resx
Original file line number Diff line number Diff line change
Expand Up @@ -1535,11 +1535,6 @@ Fundo Amarelo</value>
<value>Largura de redimensionamento preferida</value>
<comment>label</comment>
</data>
<data name="ImportCommand_noSpaces" xml:space="preserve">
<value>O OneNote não pode importar arquivos markdown de caminhos que contenham espaços:
{0}</value>
<comment>error message</comment>
</data>
<data name="ImportDialog_fileLabel.Text" xml:space="preserve">
<value>Arquivo:</value>
<comment>label</comment>
Expand Down
5 changes: 0 additions & 5 deletions OneMore/Properties/Resources.resx
Original file line number Diff line number Diff line change
Expand Up @@ -1535,11 +1535,6 @@ Yellow Background</value>
<value>Preferred resize width</value>
<comment>label</comment>
</data>
<data name="ImportCommand_noSpaces" xml:space="preserve">
<value>OneNote cannot import markdown files from paths containing spaces:
{0}</value>
<comment>error message</comment>
</data>
<data name="ImportDialog_fileLabel.Text" xml:space="preserve">
<value>File:</value>
<comment>label</comment>
Expand Down
5 changes: 0 additions & 5 deletions OneMore/Properties/Resources.zh-CN.resx
Original file line number Diff line number Diff line change
Expand Up @@ -1533,11 +1533,6 @@ OneNote 文件 (*.one)</value>
<value>首选调整宽度</value>
<comment>label</comment>
</data>
<data name="ImportCommand_noSpaces" xml:space="preserve">
<value>OneNote 无法从包含空格的路径导入 Markdown 文件:
{0}</value>
<comment>error message</comment>
</data>
<data name="ImportDialog_fileLabel.Text" xml:space="preserve">
<value>文件:</value>
<comment>label</comment>
Expand Down

0 comments on commit 9ceca41

Please sign in to comment.