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

Title is rendered incorrectly #34

Closed
rustysys-dev opened this issue Jun 2, 2020 · 4 comments
Closed

Title is rendered incorrectly #34

rustysys-dev opened this issue Jun 2, 2020 · 4 comments
Labels
bug Something isn't working

Comments

@rustysys-dev
Copy link
Contributor

After initially installing and configuring adr I run the following command.

adr lf new --name "test adr"

This creates 000001-test-adr.adoc in my source directory as expected. However the output of adr list shows that the file was created with a broken title name.

16:08:46 🖎 adr 2m34s > adr list
 Title       | Date       | Status | File                                            | Tags 
-------------+------------+--------+-------------------------------------------------+---------------------------------------
 == test adr | 2019-10-28 | wip    | /home/procyclinsur/adr/src/000001-test-adr.adoc | #Application_1 #Security #Deployment  

Opening the file in vim confirms the title is malformed.

== == test adr

I am using the default template (at the moment). The title line from the template seems to be OK.

== {%%ADR TITLE%%}

I haven't looked into the rendering code yet, but I will be doing that shortly.

@omallassi omallassi added the bug Something isn't working label Jun 2, 2020
@omallassi
Copy link
Owner

hi @rustysys-dev
this is something I observed indeed but did not take time to fix.

I guess this is coming from https://github.com/omallassi/adrust/blob/master/adr_core_local_impl/src/adr_repo/mod.rs#L369
(my regexp should not be good) but to be confirmed.

do not hesitate to do a PR.
more generally, I take any feedback :)

thx.

@rustysys-dev
Copy link
Contributor Author

@omallassi Thanks for the response.

I took a look into the code as well, and I couldn't find anything obvious, I will take a look at the Regex, and see if I can't make a PR.

omallassi added a commit that referenced this issue Jun 2, 2020
quick fix. there is certainly something cleaner to replace title in the adoc and really use the {%%ADR TITLE%%}
@omallassi
Copy link
Owner

@rustysys-dev it should fix the issue.

honestly, I should rework this more deeply. the initial idea with {%%ADR TITLE%%} was to be able to use this to replace title etc... but i did not finalize this.

at least for the
== == test adr

should be fixed now (in the master)

@rustysys-dev
Copy link
Contributor Author

rustysys-dev commented Jun 3, 2020

looks good! It was exactly what I was planning to do this morning! Found the solution last night but couldn't miss my last train!

Thanks!

I think the regex would have also worked if you used capture group 0

rustysys-dev added a commit to rustysys-dev/adrust that referenced this issue Jun 3, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants