Skip to content

Commit 8f7b118

Browse files
committed
Ensure PDF version of Reference Manual does not contain HTML <strong> tags
Prior to this commit, the PDF version of the Spring Reference Manual contained HTML <strong></strong> tags in code examples due to the fact that Asciidoctor converts bold formatting (i.e., elements wrapped in `**` or `*`) within source code blocks into HTML tags even for PDF rendering. This commit addresses this issue by removing all bold formatting from example code blocks. Closes gh-22577
1 parent 00196ea commit 8f7b118

13 files changed

+81
-83
lines changed

src/docs/asciidoc/core/core-aop.adoc

+3-3
Original file line numberDiff line numberDiff line change
@@ -1808,14 +1808,14 @@ respectively. For example, the previous pointcut can be better written as follow
18081808

18091809
====
18101810
[source,xml,indent=0]
1811-
[subs="verbatim,quotes"]
1811+
[subs="verbatim"]
18121812
----
18131813
<aop:config>
18141814
18151815
<aop:aspect id="myAspect" ref="aBean">
18161816
18171817
<aop:pointcut id="businessService"
1818-
expression="execution(* com.xyz.myapp.service.*.*(..)) **and** this(service)"/>
1818+
expression="execution(* com.xyz.myapp.service.*.*(..)) and this(service)"/>
18191819
18201820
<aop:before pointcut-ref="businessService" method="monitor"/>
18211821
@@ -3331,7 +3331,7 @@ the following example:
33313331
class="foo.StubEntitlementCalculationService"/>
33323332
33333333
<!-- this switches on the load-time weaving -->
3334-
**<context:load-time-weaver/>**
3334+
<context:load-time-weaver/>
33353335
</beans>
33363336
----
33373337
====

src/docs/asciidoc/core/core-appendix.adoc

+1-1
Original file line numberDiff line numberDiff line change
@@ -875,7 +875,7 @@ use the `NamespaceHandlerSupport` class:
875875
public class MyNamespaceHandler extends NamespaceHandlerSupport {
876876
877877
public void init() {
878-
**registerBeanDefinitionParser("dateformat", new SimpleDateFormatBeanDefinitionParser());**
878+
registerBeanDefinitionParser("dateformat", new SimpleDateFormatBeanDefinitionParser());
879879
}
880880
881881
}

src/docs/asciidoc/core/core-beans.adoc

+26-26
Original file line numberDiff line numberDiff line change
@@ -2806,7 +2806,7 @@ to do so:
28062806
[source,java,indent=0]
28072807
[subs="verbatim,quotes"]
28082808
----
2809-
**@RequestScope**
2809+
@RequestScope
28102810
@Component
28112811
public class LoginAction {
28122812
// ...
@@ -2846,7 +2846,7 @@ When using annotation-driven components or Java configuration, you can use the
28462846
[source,java,indent=0]
28472847
[subs="verbatim,quotes"]
28482848
----
2849-
**@SessionScope**
2849+
@SessionScope
28502850
@Component
28512851
public class UserPreferences {
28522852
// ...
@@ -2885,7 +2885,7 @@ following example shows how to do so:
28852885
[source,java,indent=0]
28862886
[subs="verbatim,quotes"]
28872887
----
2888-
**@ApplicationScope**
2888+
@ApplicationScope
28892889
@Component
28902890
public class AppPreferences {
28912891
// ...
@@ -4893,7 +4893,7 @@ primary `MovieCatalog`:
48934893
public class MovieConfiguration {
48944894
48954895
@Bean
4896-
**@Primary**
4896+
@Primary
48974897
public MovieCatalog firstMovieCatalog() { ... }
48984898
48994899
@Bean
@@ -4938,7 +4938,7 @@ The corresponding bean definitions follow:
49384938
49394939
<context:annotation-config/>
49404940
4941-
<bean class="example.SimpleMovieCatalog" **primary="true"**>
4941+
<bean class="example.SimpleMovieCatalog" primary="true">
49424942
<!-- inject any dependencies required by this bean -->
49434943
</bean>
49444944
@@ -4971,7 +4971,7 @@ shown in the following example:
49714971
public class MovieRecommender {
49724972
49734973
@Autowired
4974-
**@Qualifier("main")**
4974+
@Qualifier("main")
49754975
private MovieCatalog movieCatalog;
49764976
49774977
// ...
@@ -4993,7 +4993,7 @@ method parameters, as shown in the following example:
49934993
private CustomerPreferenceDao customerPreferenceDao;
49944994
49954995
@Autowired
4996-
public void prepare(**@Qualifier("main")**MovieCatalog movieCatalog,
4996+
public void prepare(@Qualifier("main") MovieCatalog movieCatalog,
49974997
CustomerPreferenceDao customerPreferenceDao) {
49984998
this.movieCatalog = movieCatalog;
49994999
this.customerPreferenceDao = customerPreferenceDao;
@@ -5113,7 +5113,7 @@ provide the `@Qualifier` annotation within your definition, as the following exa
51135113
----
51145114
@Target({ElementType.FIELD, ElementType.PARAMETER})
51155115
@Retention(RetentionPolicy.RUNTIME)
5116-
**@Qualifier**
5116+
@Qualifier
51175117
public @interface Genre {
51185118
51195119
String value();
@@ -5131,13 +5131,13 @@ following example shows:
51315131
public class MovieRecommender {
51325132
51335133
@Autowired
5134-
**@Genre("Action")**
5134+
@Genre("Action")
51355135
private MovieCatalog actionCatalog;
51365136
51375137
private MovieCatalog comedyCatalog;
51385138
51395139
@Autowired
5140-
public void setComedyCatalog(**@Genre("Comedy")** MovieCatalog comedyCatalog) {
5140+
public void setComedyCatalog(@Genre("Comedy") MovieCatalog comedyCatalog) {
51415141
this.comedyCatalog = comedyCatalog;
51425142
}
51435143
@@ -5169,12 +5169,12 @@ demonstrates both approaches:
51695169
<context:annotation-config/>
51705170
51715171
<bean class="example.SimpleMovieCatalog">
5172-
**<qualifier type="Genre" value="Action"/>**
5172+
<qualifier type="Genre" value="Action"/>
51735173
<!-- inject any dependencies required by this bean -->
51745174
</bean>
51755175
51765176
<bean class="example.SimpleMovieCatalog">
5177-
**<qualifier type="example.Genre" value="Comedy"/>**
5177+
<qualifier type="example.Genre" value="Comedy"/>
51785178
<!-- inject any dependencies required by this bean -->
51795179
</bean>
51805180
@@ -5496,7 +5496,7 @@ named `movieFinder` injected into its setter method:
54965496
54975497
private MovieFinder movieFinder;
54985498
5499-
**@Resource**
5499+
@Resource
55005500
public void setMovieFinder(MovieFinder movieFinder) {
55015501
this.movieFinder = movieFinder;
55025502
}
@@ -5705,7 +5705,7 @@ You can then use `@SessionScope` without declaring the `proxyMode` as follows:
57055705
[subs="verbatim,quotes"]
57065706
----
57075707
@Service
5708-
**@SessionScope**
5708+
@SessionScope
57095709
public class SessionScopedService {
57105710
// ...
57115711
}
@@ -5719,7 +5719,7 @@ You can also override the value for the `proxyMode`, as the following example sh
57195719
[subs="verbatim,quotes"]
57205720
----
57215721
@Service
5722-
**@SessionScope(proxyMode = ScopedProxyMode.INTERFACES)**
5722+
@SessionScope(proxyMode = ScopedProxyMode.INTERFACES)
57235723
public class SessionScopedUserService implements UserService {
57245724
// ...
57255725
}
@@ -6248,7 +6248,7 @@ technique:
62486248
[subs="verbatim,quotes"]
62496249
----
62506250
@Component
6251-
**@Qualifier("Action")**
6251+
@Qualifier("Action")
62526252
public class ActionMovieCatalog implements MovieCatalog {
62536253
// ...
62546254
}
@@ -6258,7 +6258,7 @@ technique:
62586258
[subs="verbatim,quotes"]
62596259
----
62606260
@Component
6261-
**@Genre("Action")**
6261+
@Genre("Action")
62626262
public class ActionMovieCatalog implements MovieCatalog {
62636263
// ...
62646264
}
@@ -6268,7 +6268,7 @@ technique:
62686268
[subs="verbatim,quotes"]
62696269
----
62706270
@Component
6271-
**@Offline**
6271+
@Offline
62726272
public class CachingMovieCatalog implements MovieCatalog {
62736273
// ...
62746274
}
@@ -7189,7 +7189,7 @@ as the following example shows:
71897189
public class MyConfiguration {
71907190
71917191
@Bean
7192-
**@Scope("prototype")**
7192+
@Scope("prototype")
71937193
public Encryptor encryptor() {
71947194
// ...
71957195
}
@@ -7217,7 +7217,7 @@ it resembles the following:
72177217
----
72187218
// an HTTP Session-scoped bean exposed as a proxy
72197219
@Bean
7220-
**@SessionScope**
7220+
@SessionScope
72217221
public UserPreferences userPreferences() {
72227222
return new UserPreferences();
72237223
}
@@ -7298,7 +7298,7 @@ annotation, as the following example shows:
72987298
public class AppConfig {
72997299
73007300
@Bean
7301-
**@Description("Provides a basic example of a bean")**
7301+
@Description("Provides a basic example of a bean")
73027302
public Thing thing() {
73037303
return new Thing();
73047304
}
@@ -8127,7 +8127,7 @@ can rewrite the `dataSource` configuration as follows:
81278127
[subs="verbatim,quotes"]
81288128
----
81298129
@Configuration
8130-
**@Profile("development")**
8130+
@Profile("development")
81318131
public class StandaloneDataConfig {
81328132
81338133
@Bean
@@ -8145,7 +8145,7 @@ can rewrite the `dataSource` configuration as follows:
81458145
[subs="verbatim,quotes"]
81468146
----
81478147
@Configuration
8148-
**@Profile("production")**
8148+
@Profile("production")
81498149
public class JndiDataConfig {
81508150
81518151
@Bean(destroyMethod="")
@@ -8186,7 +8186,7 @@ of creating a custom composed annotation. The following example defines a custom
81868186
----
81878187
@Target(ElementType.TYPE)
81888188
@Retention(RetentionPolicy.RUNTIME)
8189-
**@Profile("production")**
8189+
@Profile("production")
81908190
public @interface Production {
81918191
}
81928192
----
@@ -8423,7 +8423,7 @@ following example:
84238423
[subs="verbatim,quotes"]
84248424
----
84258425
@Configuration
8426-
**@Profile("default")**
8426+
@Profile("default")
84278427
public class DefaultDataConfig {
84288428
84298429
@Bean
@@ -8540,7 +8540,7 @@ a call to `testBean.getName()` returns `myTestBean`:
85408540
[subs="verbatim,quotes"]
85418541
----
85428542
@Configuration
8543-
**@PropertySource("classpath:/com/myco/app.properties")**
8543+
@PropertySource("classpath:/com/myco/app.properties")
85448544
public class AppConfig {
85458545
85468546
@Autowired

src/docs/asciidoc/core/core-validation.adoc

+1-1
Original file line numberDiff line numberDiff line change
@@ -707,7 +707,7 @@ implementation of an `initBinder(..)` method:
707707
708708
protected void initBinder(HttpServletRequest request,
709709
ServletRequestDataBinder binder) throws Exception {
710-
**this.customPropertyEditorRegistrar.registerCustomEditors(binder);**
710+
this.customPropertyEditorRegistrar.registerCustomEditors(binder);
711711
}
712712
713713
// other methods to do with registering a User

src/docs/asciidoc/data-access.adoc

+6-6
Original file line numberDiff line numberDiff line change
@@ -1078,7 +1078,7 @@ Consider the following class definition:
10781078
[subs="verbatim,quotes"]
10791079
----
10801080
// the service class that we want to make transactional
1081-
**@Transactional**
1081+
@Transactional
10821082
public class DefaultFooService implements FooService {
10831083
10841084
Foo getFoo(String fooName);
@@ -1553,7 +1553,7 @@ The following code shows the simple profiling aspect discussed earlier:
15531553
this.order = order;
15541554
}
15551555
1556-
// this method *is* the around advice
1556+
// this method is the around advice
15571557
public Object profile(ProceedingJoinPoint call) throws Throwable {
15581558
Object returnValue;
15591559
StopWatch clock = new StopWatch(getClass().getName());
@@ -1817,7 +1817,7 @@ with an anonymous class, as follows:
18171817
[source,java,indent=0]
18181818
[subs="verbatim,quotes"]
18191819
----
1820-
transactionTemplate.execute(new **TransactionCallbackWithoutResult**() {
1820+
transactionTemplate.execute(new TransactionCallbackWithoutResult() {
18211821
protected void doInTransactionWithoutResult(TransactionStatus status) {
18221822
updateOperation1();
18231823
updateOperation2();
@@ -1840,7 +1840,7 @@ Code within the callback can roll the transaction back by calling the
18401840
updateOperation1();
18411841
updateOperation2();
18421842
} catch (SomeBusinessException ex) {
1843-
**status.setRollbackOnly();**
1843+
status.setRollbackOnly();
18441844
}
18451845
}
18461846
});
@@ -2606,7 +2606,7 @@ the setter for the `DataSource`. This leads to DAOs that resemble the following:
26062606
private JdbcTemplate jdbcTemplate;
26072607
26082608
public void setDataSource(DataSource dataSource) {
2609-
**this.jdbcTemplate = new JdbcTemplate(dataSource);**
2609+
this.jdbcTemplate = new JdbcTemplate(dataSource);
26102610
}
26112611
26122612
// JDBC-backed implementations of the methods on the CorporateEventDao follow...
@@ -5044,7 +5044,7 @@ errors in the SQL it executes from the scripts, as the following example shows:
50445044
[source,xml,indent=0]
50455045
[subs="verbatim,quotes"]
50465046
----
5047-
<jdbc:initialize-database data-source="dataSource" **ignore-failures="DROPS"**>
5047+
<jdbc:initialize-database data-source="dataSource" ignore-failures="DROPS">
50485048
<jdbc:script location="..."/>
50495049
</jdbc:initialize-database>
50505050
----

src/docs/asciidoc/integration-appendix.adoc

+4-4
Original file line numberDiff line numberDiff line change
@@ -47,12 +47,12 @@ The following example shows how to use JNDI to look up a data source without the
4747
[source,xml,indent=0]
4848
[subs="verbatim,quotes"]
4949
----
50-
<bean id="**dataSource**" class="org.springframework.jndi.JndiObjectFactoryBean">
50+
<bean id="dataSource" class="org.springframework.jndi.JndiObjectFactoryBean">
5151
<property name="jndiName" value="jdbc/MyDataSource"/>
5252
</bean>
5353
<bean id="userDao" class="com.foo.JdbcUserDao">
5454
<!-- Spring will do the cast automatically (as usual) -->
55-
<property name="dataSource" ref="**dataSource**"/>
55+
<property name="dataSource" ref="dataSource"/>
5656
</bean>
5757
----
5858
====
@@ -64,11 +64,11 @@ schema:
6464
[source,xml,indent=0]
6565
[subs="verbatim,quotes"]
6666
----
67-
<jee:jndi-lookup id="**dataSource**" jndi-name="jdbc/MyDataSource"/>
67+
<jee:jndi-lookup id="dataSource" jndi-name="jdbc/MyDataSource"/>
6868
6969
<bean id="userDao" class="com.foo.JdbcUserDao">
7070
<!-- Spring will do the cast automatically (as usual) -->
71-
<property name="dataSource" ref="**dataSource**"/>
71+
<property name="dataSource" ref="dataSource"/>
7272
</bean>
7373
----
7474
====

0 commit comments

Comments
 (0)