commit 0ea9558e3f74eeaecf25eecb415a94856e63983e parent a1dd4b0aa778eb07d3252c3bc3dd904a3d44218a Author: falkTX <falktx@falktx.com> Date: Sun, 4 Jul 2021 10:00:53 +0100 Fix LV2 export of comments with newlines Diffstat:
M | distrho/src/DistrhoPluginLV2export.cpp | | | 9 | +++++++-- |
1 file changed, 7 insertions(+), 2 deletions(-)
diff --git a/distrho/src/DistrhoPluginLV2export.cpp b/distrho/src/DistrhoPluginLV2export.cpp @@ -755,7 +755,7 @@ void lv2_generate_ttl(const char* const basename) // unit const String& unit(plugin.getParameterUnit(i)); - if (unit.isNotEmpty() && ! unit.contains(" ")) + if (unit.isNotEmpty() && ! unit.contains(' ')) { String lunit(unit); lunit.toLower(); @@ -806,7 +806,12 @@ void lv2_generate_ttl(const char* const basename) const String& comment(plugin.getParameterDescription(i)); if (comment.isNotEmpty()) - pluginString += " rdfs:comment \"\"\"" + comment + "\"\"\" ;\n"; + { + if (comment.contains('"') || comment.contains('\n')) + pluginString += " rdfs:comment \"\"\"" + comment + "\"\"\" ;\n"; + else + pluginString += " rdfs:comment \"" + comment + "\" ;\n"; + } // hints const uint32_t hints(plugin.getParameterHints(i));