Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HTML tags stripping #50

Closed
rtsisyk opened this issue Nov 1, 2023 · 6 comments
Closed

HTML tags stripping #50

rtsisyk opened this issue Nov 1, 2023 · 6 comments
Assignees
Labels
enhancement New feature or request

Comments

@rtsisyk
Copy link

rtsisyk commented Nov 1, 2023

It looks like that Huawei's AppGallery doesn't support HTML tags in the release notes and description, like Google Play does.

image

Please consider adding automated stripping of HTML tags to allow sharing of the same description with Google Play.

@cosic
Copy link
Contributor

cosic commented Nov 10, 2023

@rtsisyk Hi! I don't like idea to add some html tags stripper into the plugin because it should be stupid and not thinging about what a release notes text it got. But inspired your idea I'm going to add new param text which would hight priorited then filePath. So you can create function in gradle build script wich would fetch release noted and strip html from text on your side.

For example

huaweiPublish {
    instances {
        create("release") {
            releaseNotes = listOf(
		        ru.cian.huawei.publish.ReleaseNote(
		            lang = "ru-RU",
		            text = getReleaseNotes("$projectDir/release-notes-ru.txt")
		        ),
		        ru.cian.huawei.publish.ReleaseNote(
		            lang = "en-US",
		            text = getReleaseNotes("$projectDir/release-notes-en.txt")
		        )
		    )
	    }	
    }
}

and

fun getReleaseNotes(filePath: String): String {
	return File(filePath).readAll().replaceAll("\\<[^>]*>","")
}

What do you think about it?

@rtsisyk
Copy link
Author

rtsisyk commented Nov 11, 2023

The best option would be to support Triple-T structure out of the box.

@cosic
Copy link
Contributor

cosic commented Nov 12, 2023

@rtsisyk How does Triple-T Release Notes structure help us to solve problem that AppGallery doesn't support html tags?

cosic added a commit that referenced this issue Dec 3, 2023
…ed release notes. For example, to support Google Play release notes.
@cosic
Copy link
Contributor

cosic commented Dec 3, 2023

@rtsisyk Hi! Please try a new 1.4.1-SNAPSHOT version with a new removeHtmlTags parameter. For more information see README/snapshot-1.4.1.

Pay attention I've changed releaseNotes block. Instead of

           releaseNotes = listOf(
                ru.cian.rustore.publish.ReleaseNote(
                          lang = "en-US",
                          filePath = "$projectDir/release-notes-en.txt"
                ),
            )

new configuration

          releaseNotes = ru.cian.huawei.publish.ReleaseNotesExtension(
              descriptions = listOf(
                  ru.cian.huawei.publish.ReleaseNote(
                          lang = "en-US",
                          filePath = "$projectDir/release-notes-en.txt"
                  )
              ),
              removeHtmlTags = false
          )

And I remember you are using a trick to support Google Play languages. A new version should be

huaweiPublish {
  instances {
    huaweiRelease {
      credentialsPath = "$rootDir/huawei-appgallery.json"
      buildFormat = 'aab'
      deployType = 'draft' // confirm manually
      releaseDescriptions = []
      def localeOverride = [
          'am' : 'am-ET',
          'gu': 'gu_IN',
          'iw-IL': 'he_IL',
          'kn-IN': 'kn_IN',
          'ml-IN': 'ml_IN',
          'mn-MN': 'mn_MN',
          'mr-IN': 'mr_IN',
          'ta-IN': 'ta_IN',
          'te-IN': 'te_IN',
      ]
      def files = fileTree(dir: "$projectDir/src/google/play/release-notes",
          include: '**/default.txt')
      files.each { File file ->
        def path = file.getPath()
        def locale = file.parentFile.getName()
        locale = localeOverride.get(locale, locale)
        releaseDescriptions.add(new ru.cian.huawei.publish.ReleaseNote(locale, path))
      }
      releaseNotes = new ru.cian.huawei.publish.ReleaseNotesExtension(releaseDescriptions, true)
    }
  }
}

@rtsisyk
Copy link
Author

rtsisyk commented Dec 15, 2023

@rtsisyk Hi! Please try a new 1.4.1-SNAPSHOT version with a new removeHtmlTags parameter. For more information see README/snapshot-1.4.1.

Wow, fantastic! Sorry for the silence. I will try.

@cosic
Copy link
Contributor

cosic commented Dec 19, 2023

@rtsisyk Hi! In 1.4.1 version has been found a small issue. Please try 1.4.2.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants