diff --git a/src/asciidoc/templates/Listing.tsx b/src/asciidoc/templates/Listing.tsx
index c66263c..8cf47db 100644
--- a/src/asciidoc/templates/Listing.tsx
+++ b/src/asciidoc/templates/Listing.tsx
@@ -7,7 +7,6 @@ const Listing = ({ node }: { node: LiteralBlock }) => {
const { document } = useConverterContext()
const docAttrs = document.attributes || {}
- const nowrap = node.attributes.nowrap || docAttrs['prewrap'] === undefined
if (node.style === 'source') {
const lang = node.language
@@ -19,7 +18,7 @@ const Listing = ({ node }: { node: LiteralBlock }) => {
>
diff --git a/src/asciidoc/utils/prepareDocument.ts b/src/asciidoc/utils/prepareDocument.ts
index d28d17b..3cea0b9 100644
--- a/src/asciidoc/utils/prepareDocument.ts
+++ b/src/asciidoc/utils/prepareDocument.ts
@@ -147,6 +147,8 @@ export interface LiteralBlock extends BaseBlock {
type: 'listing'
source: string
language: string | undefined
+ decodedContent: string
+ noWrap: boolean
}
export interface SectionBlock extends BaseBlock {
@@ -325,14 +327,13 @@ export const prepareDocument = (document: AdocTypes.Document) => {
}
if (type === 'listing' || type === 'literal') {
+ const listingBlock = processedBlock as LiteralBlock
if ('getSource' in block) {
- const listingBlock = processedBlock as LiteralBlock
listingBlock.source = block.getSource()
- listingBlock.language = block.getAttribute('language')
- listingBlock.content = listingBlock.content
- ? decode(listingBlock.content)
- : undefined
}
+ listingBlock.noWrap = block.isOption('nowrap')
+ listingBlock.language = block.getAttribute('language')
+ listingBlock.decodedContent = decode(listingBlock.content)
}
if (type === 'section') {
diff --git a/src/examples/listing.js b/src/examples/listing.js
index e3b0285..0db49bc 100644
--- a/src/examples/listing.js
+++ b/src/examples/listing.js
@@ -67,6 +67,11 @@ public class ApplicationConfigurationProvider extends HttpConfigurationProvider
}
}
----
+
+// html tags
+----
+MPN1::::
+----
`
export default listing