Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
shenlebantongying opened this issue Sep 26, 2024 · 1 comment
Open

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

shenlebantongying opened this issue Sep 26, 2024 · 1 comment

Comments

@shenlebantongying
Copy link

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

@yozhic
Copy link
Owner

yozhic commented Sep 26, 2024

Thank you, those are substantive comments.

The original plan was to describe in the guide only the interaction of dsl with Lingvo, since Lingvo is the parent of dsl. GoldenDict was mentioned in rare cases, only for comparison. But times are changing. Now, perhaps, it would not be superfluous to list all the specifics of interaction between dsl and GoldenDict.

Only I will have to think how to do it better, because sometimes processing depends not on GoldenDict, but on QWebKit built into it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants