Editor conversion fails when a page contains unsupported <span> elements

XMLWordPrintable

    • 1
    • Major
    • 3
    • Warranty

      Issue Summary

      Editor conversion is failing when the page content contains unsupported <span> tags.

      Steps to Reproduce

      1. Create a page using this storage format. Notice that the list item contains a span tag within a strong tag, which is unsupported.

      <ul>
          <li>List item <strong>
                  <span
                      class="status-macro aui-lozenge aui-lozenge-subtle conf-macro output-inline"
                      style="text-decoration: none;">
                      <ac:structured-macro ac:name="status"
                          ac:schema-version="1"
                          ac:macro-id="test-id">
                          <ac:parameter
                              ac:name="subtle">true</ac:parameter>
                          <ac:parameter
                              ac:name="title">Title</ac:parameter>
                      </ac:structured-macro>
                  </span>
              </strong>
          </li>
      </ul> 

      2. Convert the page to the new editor.

      Expected Results

      The conversion should succeed and the page should render in the new editor.

      Actual Results

      The below exception is thrown:

      com.atlassian.confluence.content.render.xhtml.XhtmlException: RuntimeException occurred while performing an XHTML storage transformation (Expected strong end element but got: </span>)
      com.atlassian.confluence.content.render.xhtml.atlassiandocformat.StorageXhtmltoADFTransformer.transform(StorageXhtmltoADFTransformer.java:150)
      com.atlassian.confluence.content.render.xhtml.DefaultRenderer.renderWithoutMetrics(DefaultRenderer.java:183)
      com.atlassian.confluence.content.render.xhtml.DefaultRenderer.renderWithResult(DefaultRenderer.java:148)
      com.atlassian.confluence.content.render.xhtml.DefaultFormatConverter.convertToAtlasDocFormatWithResult(DefaultFormatConverter.java:251)
      com.atlassian.confluence.content.render.xhtml.DefaultFormatConverter.lambda$convertToAtlasDocFormatWithResult$1(DefaultFormatConverter.java:322)
      java.base/java.util.Optional.orElseGet(Unknown Source)
      com.atlassian.confluence.content.render.xhtml.DefaultFormatConverter.convertToAtlasDocFormatWithResult(DefaultFormatConverter.java:320)
      com.atlassian.confluence.modules.domains.contentconversion.impl.ContentBodyConversionManagerImpl.lambda$convertValueAndLogUnsuccessful$14(ContentBodyConversionManagerImpl.java:535)
      com.atlassian.confluence.modules.infra.common.logging.LoggingContext$LoggingContextBuilderDefault.get(LoggingContext.java:293)
      com.atlassian.confluence.modules.domains.contentconversion.impl.ContentBodyConversionManagerImpl.convertValueAndLogUnsuccessful(ContentBodyConversionManagerImpl.java:535)
      com.atlassian.confluence.modules.domains.contentconversion.impl.ContentBodyConversionManagerImpl.lambda$convert$1(ContentBodyConversionManagerImpl.java:212)
      com.atlassian.confluence.api.impl.service.content.ThreadlocalWebResourceDependenciesRecorder.record(ThreadlocalWebResourceDependenciesRecorder.java:93)
      com.atlassian.confluence.modules.domains.contentconversion.impl.ContentBodyConversionManagerImpl.computeConversionResourcesInternal(ContentBodyConversionManagerImpl.java:318)
      com.atlassian.confluence.modules.domains.contentconversion.impl.ContentBodyConversionManagerImpl.computeConversionResources(ContentBodyConversionManagerImpl.java:311)
      com.atlassian.confluence.modules.domains.contentconversion.impl.ContentBodyConversionManagerImpl.convert(ContentBodyConversionManagerImpl.java:211)
      com.atlassian.confluence.api.impl.service.content.factory.api.ContentBodyFactory.makeContentBody(ContentBodyFactory.java:184)
      com.atlassian.confluence.api.impl.service.content.factory.api.ContentBodyFactory.makeContentBodies(ContentBodyFactory.java:141)
      com.atlassian.confluence.api.impl.service.content.factory.ContentFactory.makeContentBodies(ContentFactory.java:853)
      com.atlassian.confluence.api.impl.service.content.factory.ContentFactory.gen1builder(ContentFactory.java:332)
      com.atlassian.confluence.api.impl.service.content.factory.ContentFactory.buildersFrom(ContentFactory.java:309)
      com.atlassian.confluence.api.impl.service.content.factory.ContentFactory.buildFrom(ContentFactory.java:274)
      com.atlassian.confluence.api.impl.service.content.factory.ContentModelFactory.buildFrom(ContentModelFactory.java:35)
      com.atlassian.confluence.api.impl.service.content.ContentServiceImpl.buildContentWithoutChecks(ContentServiceImpl.java:1484)
      com.atlassian.confluence.api.impl.service.content.ContentServiceImpl.buildContent(ContentServiceImpl.java:1407)
      com.atlassian.confluence.api.impl.service.content.finder.ContentFinderImpl.internalFetchById(ContentFinderImpl.java:537)
      com.atlassian.confluence.api.impl.service.content.finder.ContentFinderImpl.fetchOneOrValidationResult(ContentFinderImpl.java:238)
      com.atlassian.confluence.api.impl.service.content.finder.ContentFinderImpl.fetchOneOrThrow(ContentFinderImpl.java:214)
      java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(Unknown Source)
      java.base/java.lang.reflect.Method.invoke(Unknown Source)
      org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:344)
      org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:198)
      org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:163)
      org.springframework.transaction.interceptor.TransactionInterceptor$1.proceedWithInvocation(TransactionInterceptor.java:123)
      org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:388)
      org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:119)
      org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186)
      org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:241)
      jdk.proxy4/jdk.proxy4.$Proxy3073.fetchOneOrThrow(Unknown Source)
      com.atlassian.confluence.plugins.graphql.providers.content.ContentGraphQLProvider.getContentById(ContentGraphQLProvider.java:572)
      com.atlassian.confluence.plugins.graphql.providers.content.ContentGraphQLProvider.getContentByGraph(ContentGraphQLProvider.java:376)
      java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(Unknown Source)
      java.base/java.lang.reflect.Method.invoke(Unknown Source)
      com.atlassian.graphql.datafetcher.MethodDataFetcher.get(MethodDataFetcher.java:107)
      com.atlassian.graphql.json.jersey.JerseyResourceMethodDataFetcher.get(JerseyResourceMethodDataFetcher.java:72)
      com.atlassian.graphql.utils.DataFetcherFactory.lambda$createDataFetcherAndValueTransformer$0(DataFetcherFactory.java:48)
      com.atlassian.confluence.plugins.graphql.extensions.ExternalShareAllowedGraphQLExtension.lambda$getDataFetcherThunk$0(ExternalShareAllowedGraphQLExtension.java:73)
      com.atlassian.confluence.plugins.graphql.extensions.AsapAllowedExtension.lambda$getDataFetcherThunk$1(AsapAllowedExtension.java:66)
      com.atlassian.confluence.plugins.graphql.extensions.MetricExtension.lambda$getDataFetcherThunk$0(MetricExtension.java:71)
      com.atlassian.confluence.plugins.graphql.extensions.QueryStringExtension.lambda$getDataFetcherThunk$0(QueryStringExtension.java:34)
      com.atlassian.confluence.plugins.graphql.extensions.ReplicaSupportExtension.lambda$createDataFetcherWithContextReset$1(ReplicaSupportExtension.java:127)
      com.atlassian.confluence.plugins.graphql.extensions.ReplicaSupportExtension.lambda$createDataFetcherWithTag$0(ReplicaSupportExtension.java:105)
      com.atlassian.confluence.plugins.graphql.extensions.AllowNonConfluenceUserExtension.lambda$getDataFetcherThunk$1(AllowNonConfluenceUserExtension.java:57)
      com.atlassian.graphql.instrumentation.metrics.MetricsInstrumentation$InstrumentedDataFetcher.get(MetricsInstrumentation.java:78)
      io.opentelemetry.instrumentation.graphql.v20_0.OpenTelemetryInstrumentation.lambda$instrumentDataFetcher$1(OpenTelemetryInstrumentation.java:77)
      graphql.execution.ExecutionStrategy.invokeDataFetcher(ExecutionStrategy.java:327)
      graphql.execution.ExecutionStrategy.fetchField(ExecutionStrategy.java:304)
      graphql.execution.ExecutionStrategy.fetchField(ExecutionStrategy.java:242)
      graphql.execution.ExecutionStrategy.resolveFieldWithInfo(ExecutionStrategy.java:213)
      com.atlassian.graphql.utils.AsyncExecutionStrategyWithExecutionListenerSupport.lambda$resolveFieldWithInfo$0(AsyncExecutionStrategyWithExecutionListenerSupport.java:22)
      com.atlassian.graphql.utils.AsyncExecutionStrategyWithExecutionListenerSupport.resolveField(AsyncExecutionStrategyWithExecutionListenerSupport.java:33)
      com.atlassian.graphql.utils.AsyncExecutionStrategyWithExecutionListenerSupport.resolveFieldWithInfo(AsyncExecutionStrategyWithExecutionListenerSupport.java:22)
      com.atlassian.graphql.utils.AsyncExecutionStrategyIgnoreUndefinedFields.resolveFieldWithInfo(AsyncExecutionStrategyIgnoreUndefinedFields.java:29)
      graphql.execution.AsyncExecutionStrategy.execute(AsyncExecutionStrategy.java:63)
      graphql.execution.Execution.executeOperation(Execution.java:162)
      graphql.execution.Execution.execute(Execution.java:105) 

      Workaround

      Remove the unsupported span tags from the body content.

              Assignee:
              Unassigned
              Reporter:
              Josh Ramos
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

                Created:
                Updated: