Skip to content

GoldenDict's handling of [url] and [s] #3

@shenlebantongying

Description

@shenlebantongying

Not sure if these are worth mentioning, but I will just put them down here 😅.

[s] will fall back to text link that opens any type of resources

[s]a.pdf[/s]

can open the a.pdf inside .dsl.files.zip

Because it falls back to become a link. GD will put that file in a temporal folder so that external programs can open it.

https://github.com/goldendict/goldendict/blob/b2366124ef0d5c02ef208c40e1de709507faa19d/dsl.cc#L962-L972

Open local file relative to main .dsl file

Added in goldendict/goldendict@b236612

[url target="file:///a.pdf"] some text [/url]
[url target="file://./a.pdf"] some text [/url]

will open the PDF file like this:

.
├── a.dsl
└── asd.pdf
Auto adding http://

<p>Адрес интернет-страницы должен начинаться с <span class="code">www.</span> или <span class="code">http://</span>, или <span class="code">https://</span>, иначе ссылка станет неработоспособной.</p>

In GD, any link without scheme will have http:// added.

https://github.com/goldendict/goldendict/blob/d9ef605e58eeca95acadcab758ac7587b2943752/dsl.cc#L1047-L1048

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions