This repository has been archived by the owner on Oct 2, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
23 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
5f5d300
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A couple of notes. First, our implementation of shortcuts differs from the official RFC which requires that, "The shortened URL MUST include an
id
query parameter, for example:" (emphasis in original)However, Trinsic currently uses, for example:
and this code change will use something like:
We wouldn't be able to get as short a URL if we followed the spec. It would be about 30 characters longer, with redundancy:
5f5d300
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Second note is about embedding KRL expressions in Javascript expressions in an HTML
script
tag. See, for example, this code:The HTML code is embedded in chevron quotes
<<
and>>
and the closing chevron quote cannot immediately follow the closing script tag (because>>>
stumps the KRL parser).KRL expressions are embedded in the JavaScript code using the beesting
#{...}
.There are two occurrences of the in-line operater
||
, the first inside a beestring (and thus executed as KRL code), and the second is just Javascript code. The overall effect is that if the KRL nameorig
happens to benull
it will be replaced by the KRL empty string, resulting in a JavaScript empty string, so that the Javascript/DOM value oflocation.href
will be used as thetext
for the QR Code. The same thing would happen if theorig
value was the empty string. Otherwise, thetext
value for the QR Code will be the KRL value oforig
converted to a JavaScript string by the double quotes surrounding the beesting.