override fun convertDocument()

in src/main/kotlin/circlet/cli/confluence/HtmlToMarkdownConverter.kt [23:37]


    override fun convertDocument(documentInfo: DocumentInfo): TextDocumentContent {
        val converter = FlexmarkHtmlConverter
            .builder()
            .linkResolverFactory(linkResolverFactory)
            .also {
                it.set(FlexmarkHtmlConverter.EXT_INLINE_INS, ExtensionConversion.TEXT)
                it.set(FlexmarkHtmlConverter.OUTPUT_ATTRIBUTES_ID, false)
                it.set(TableFormatOptions.FORMAT_TABLE_ADJUST_COLUMN_WIDTH, false)
            }
            .build()
        val documentBody = documentInfo.body?.exportView?.value
            ?: throw IllegalArgumentException("Can't convert document without export view")
        val mdContent = converter.convert(documentBody)
        return MdTextDocumentContent(mdContent)
    }