mirror of
https://git.sr.ht/~edwardloveall/scribe
synced 2025-12-17 08:01:21 +00:00
Handle gists with file extensions
Somehow, in my Gist Proxy code 7518a035b1 I never accounted for gist
ids with file extensions. For example: `def123.js` instead of plain
`def123`. This is now fixed and articles with those kinds of gists in
them work now.
Reference article:
https://medium.com/neat-tips-tricks/ocaml-continuation-explained-3b73839
b679f
This commit is contained in:
@@ -10,6 +10,16 @@ describe GistParams do
|
||||
params.filename.should eq("example.txt")
|
||||
end
|
||||
|
||||
describe "when gist file has a file extension" do
|
||||
it "extracts params from the gist url" do
|
||||
url = "https://gist.github.com/user/1d.js"
|
||||
|
||||
params = GistParams.extract_from_url(url)
|
||||
|
||||
params.id.should eq("1d")
|
||||
end
|
||||
end
|
||||
|
||||
describe "when no file param exists" do
|
||||
it "does not extract a filename" do
|
||||
url = "https://gist.github.com/user/1D"
|
||||
|
||||
Reference in New Issue
Block a user