Login  Register

Re: Bold Source Code and Escaping

Posted by rwinch on Aug 20, 2013; 2:47am
URL: https://discuss.asciidoctor.org/Bold-Source-Code-and-Escaping-tp464p472.html

Dan,

Thank you for your very informative response.

I may just be missing something, but I don't think this solves my initial use case (correct me if I am wrong). I would like to bold a line with two ** in it. For example the following bolds the first half of the line, but the bold ends as soon as it hits the ** within the code.

[source,java]
[subs="verbatim,macros"]
----
protected void configure(HttpSecurity http) throws Exception {
        http
            .authorizeRequests()
                pass:verbatim,quotes[**.antMatchers("/resources/**").permitAll()**]
                .anyRequest().authenticated()
                .and()
            .formLogin()
                .loginPage("/login")
                .permitAll();
----

I tried escaping the code's ** using $$, but I believe the verbatim gets in the way of $$ working. I also tried removing the verbatim from the macro and using $$ as shown below, but it is still not working as I would like:

[source,java]
[subs="verbatim,macros"]
----
protected void configure(HttpSecurity http) throws Exception {
        http
            .authorizeRequests()
                pass:quotes[**.antMatchers("/resources/$$**$$").permitAll()**]
                .anyRequest().authenticated()
                .and()
            .formLogin()
                .loginPage("/login")
                .permitAll();
----

 It may be something I am just missing, so if anyone can help me with this last piece I'd be extremely grateful.

Thanks again,
Rob Winch