(meta has many many themes, but luckily thanks to @kris.kotlarek we have an add to all themes button⌠got to sort out progress there, cause it takes a while to do its magic)
I never got into BB script tags, nor have I hand-coded FontAwesome, so the practice of using an empty tag pair has always seemed strange to me. Is that by popular convention, or is there a webcraft reason for using tag pairs? Also, can they have stuff between them, does that affect the text?
First when I wrote the wrap BBCode feature, @sam explicitly asked to me support 3 formats:
[wrap=foo][/wrap]
[wrap=foo]bar[/wrap]
[wrap=foo]
bar
[/wrap]
This is done to be consistent with our existing BBCode usage in Discourse.
I could have a better syntax as: [icon=times] but then it would have to be a plugin and not a theme component.
As an experimentation, I think itâs fine as it is today, and if people were to use it a lot, we could think of having a plugin do this with a more concise syntax.
Another idea I have had is to add an API to add autocompletes symbol in the composer just like we have fore users/categories/emojis⌠But Iâm afraid this would be a nightmare with multiple components choosing their own symbolâŚ
Oh! I need to add support for another bbcode and those) thought that Iâd use this as a starting point, but youâre saying that the wrap stuff is handled in core, which explains why I canât find how itâs handled by your theme component.
My current solution is to use the linked words component and an ugly regex, but Iâm still struggling to add the necessary classes to the links.
Right Iâve looked at it a dozen times. And printed out the code for your component and stared at it for hours, trying to understand if the degree to which itâs javascript or ember that I donât understand. I canât add a [foo] tag without a plugin? Or can I some how replace wrap in your code with foo to cover my new bbcode?
No you canât. Because part of it is server side. If you want your own custom BBCode you will have to write a plugin and look at how wrap is implemented for example:
Thanks! Itâs starting to make sense. Iâve not had this much trouble learning a new language since C++ and objective Pascal in 1990.
My current regex hack almost works. Iâll need to decide whether to go the plugin route or stick with my hack (and figure out how to add the classes).
At least now I understand why I canât find that wrap in the theme component!
Utilizzare un wrapper di icone in una frase in un post. es. Questo è un'icona [wrap=icon id=far-check-square][/wrap]
Evidenziare il testo pertinente e âCitaâ
Lâicona diventa super grande nellâestratto citato
Questo è lâaspetto della sintassi quando viene evidenziata e citata:
[quote="JammyDodger, post:1, topic:294, full:true"]
This is an icon 
[/quote]
Questa è una risposta in cui diventa enorme
Tuttavia, citarla usando la bolla di dialogo nella barra del formato funziona bene.
Puoi fornire un esempio? Il tuo screenshot mostra una casella di controllo selezionata e non ho problemi a selezionarla nella mia istanza di test (cosĂŹ come altre icone probabilmente non utilizzate da Discourse come x-ray).
Vedo il problema. Il componente cerca controllando se câè un wrapper con la classe d-wrap; ma non câè alcun wrapper se lâicona fornita non proviene dal sottoinsieme. Crea invece unâimmagine come SVG.
Se citi le immagini, il componente non fa nulla, poichĂŠ non câè alcun wrapper (e lâimmagine viene convertita in markdown, risultando in unâimmagine senza alcuna classe)
Questo significa che devo avere un campo svg_icons in settings.yml disponibile nel mio tema? Oppure potrei usare qualsiasi campo svg_icons disponibile da qualsiasi componente tema abilitato? E in tal caso, avrebbe senso aggiungere questo campo a questo componente tema?
PerchĂŠ nella mia esperienza, le icone SVG vengono trasformate in tag <img /> e non ereditano currentColor quando lo schema di colori viene modificato:
Confronta il paragrafo Esempio: