dwp-forge / refnotes

4 stars 6 forks source link

Breaks template when URL is used on title #79

Closed eduardomozart closed 7 months ago

eduardomozart commented 11 months ago

Hello, When incorrectly creating a reference like below using BibTex where I set the title as URL:

====== pfSense ======

<code bibtex>
@Comment{refnotes,
  namespace = "harvard"
}

@Book{Udemy-pfSense-Ninja,
  author = "Luciano {Rodrigues}",
  ref-author = "Rodrigues",
  title = "https://udemy.com/course/ninja-pfsense",
  publisher = "Udemy",
  year = 2023
}
</code>

And creating a page with the following text:

====== AAD Connect ======

===== Sincronização do AD com a Nuvem (Azure) =====

<WRAP center round alert 60%>
**Desativação das versões 1.x do Azure AD Connect**

A sincronização deixará de funcionar em 1º de outubro de 2023, para todos os clientes que ainda estiverem executando o Azure AD Connect Sync V1. [(:harvard:MSDN-AAD-Connect-Version-History)]

Os clientes que usam a sincronização de nuvem ou o Azure AD Connect V2 permanecerão totalmente operacionais, sem necessidade de nenhuma ação. Esta versão requer o Windows Server 2016 ou mais recente. [(:harvard:MSDN-AAD-Connect-Version-History)] [(:harvard:Udemy-pfSense-Ninja)]
</WRAP>

===== Referências =====

[(:harvard:MSDN-AAD-Connect-Version-History>>
title: Azure AD Connect: Histórico de lançamento de versões
author: Microsoft Learn
url: https://learn.microsoft.com/pt-br/azure/active-directory/hybrid/connect/reference-connect-version-history
year: 2023
)]

When using the Read the Dokus template, it's breaking the page layout and everything below the references are in Italic:

image

I know that URLs shouldn't be used on Title and it was my mistake, but I believe it shouldn't be happening. I believe it happens because the URL contains two // after http: on the Reference title.

dwp-forge commented 7 months ago

This has little to do with the plugin itself but rather is an artifact of DW syntax parsing. You can see this behavior with a basic test not involving the plugin at all.

====== Test #79 ======

Raw URL https://www.dokuwiki.org.

Raw URL with emphasis //https://www.dokuwiki.org//.

This is going to be messed up.

===== This as well =====

//

Back to normal.

This is going to be rendered as:

image

One could argue that the plugin causes the problem by adding emphasis to the book title. But that's part of Harvard formatting convention, so removing that just because of this mishap would be undesirable. Similarly I don't think issue warrants completely disabling DW formatting inside the book title. There are features like DW entities, which could be useful. OTOH, creating a specific rule for a URL used as book title seems rather random to me. After all, there are multiple ways you can create an invalid DW syntax and that's not a job of this plugin to protect you from that.

dwp-forge commented 7 months ago

And if you ever actually do want to have URL in the title, you still can do that by explicitly wrapping it in DW syntax:

@Book{:ref:Udemy-pfSense-Ninja,
  author = "Luciano {Rodrigues}",
  ref-author = "Rodrigues",
  title = "[[https://udemy.com/course/ninja-pfsense]]",
  publisher = "Udemy",
  year = 2023
}