feat: check for trailing/leading slash in jae
crookse opened this issue · comments
Summary
What:
Jae (in Tengine) line 76 concatenates this.views_path
and template
. The expected strings should look like:
this.view_path = "./views";
template = "/some-template.html"
... so that the concatenation becomes ./views/some-template.html
. However, users most likely do:
this.view_path = "./views";
template = "some-template.html"
... so that the concatenation becomes ./viewssome-template.html
. This results in an error.
We need to make sure of the following:
- If
this.views_path
has a trailing slash andtemplate
has a leading slash, then remove one of them - If
this.views_path
does not have a trailing slash andtemplate
does not have a leading slash, then add the slash.
This makes Jae
less error prone and it does not matter if the user has a random combination of trailing/leading slashes -- Jae
wlll figure out what to do.
Why:
Users expect to use Tengine differently.
Acceptance Criteria
Below is a list of tasks that must be completed before this issue can be closed.
- Write documentation
- Write unit tests
- Write integration tests