Repository: intellij-rust/intellij-rust
Issue: Dependency line using single quotes results in broken link

## Environment

* **IntelliJ Rust plugin version:** 0.2.112.2148-193
* **Rust toolchain version:** 1.40.0
* **IDE name and version:** PyCharm Professional 2019.3
* **Operating system:** Arch Linux

## Problem description
When a dependency line reads `quicli = '0.4.0'`, it will link to https://docs.rs/quicli/'0.4.0'/quicli, which is obviously wrong.


Changed files:
toml/src/test/kotlin/org/rust/toml/CargoCrateDocLineMarkerProviderTest.kt, toml/src/main/kotlin/org/rust/toml/CargoCrateDocLineMarkerProvider.kt

diff --git a/toml/src/main/kotlin/org/rust/toml/CargoCrateDocLineMarkerProvider.kt b/toml/src/main/kotlin/org/rust/toml/CargoCrateDocLineMarkerProvider.kt
index 3d394ebf8..e0e164b90 100644
--- a/toml/src/main/kotlin/org/rust/toml/CargoCrateDocLineMarkerProvider.kt
+++ b/toml/src/main/kotlin/org/rust/toml/CargoCrateDocLineMarkerProvider.kt
@@ -12,6 +12,8 @@ import com.intellij.openapi.editor.markup.GutterIconRenderer
 import com.intellij.psi.PsiElement
 import org.rust.ide.icons.RsIcons
 import org.toml.lang.psi.*
+import org.toml.lang.psi.ext.TomlLiteralKind
+import org.toml.lang.psi.ext.kind
 
 class CargoCrateDocLineMarkerProvider : LineMarkerProvider {
     override fun getLineMarkerInfo(element: PsiElement): LineMarkerInfo<*>? = null
@@ -31,7 +33,7 @@ class CargoCrateDocLineMarkerProvider : LineMarkerProvider {
         val test = names.getOrNull(names.size - 2)
         val lastName = names.lastOrNull() ?: return emptyList()
         if (test?.isDependencyKey == true) {
-            val version = el.entries.find { it.name == "version" }?.value?.text?.unquotedText
+            val version = el.entries.find { it.name == "version" }?.value?.stringValue
             val lineMarkerInfo = genLineMarkerInfo(el.header.names.first(), lastName.text, version) ?: return emptyList()
             return listOf(lineMarkerInfo)
         }
@@ -62,7 +64,7 @@ private val TomlKeyValue.name get() = key.text
 private val TomlKeyValue.crateName: String
     get() {
         return when (val rootValue = value) {
-            is TomlInlineTable -> (rootValue.entries.find { it.name == "package" }?.value?.text?.unquotedText)
+            is TomlInlineTable -> (rootValue.entries.find { it.name == "package" }?.value?.stringValue)
                 ?: key.text
             else -> key.text
         }
@@ -70,10 +72,13 @@ private val TomlKeyValue.crateName: String
 private val TomlKeyValue.version: String?
     get() {
         return when (val value = value) {
-            is TomlLiteral -> value.text?.unquotedText
-            is TomlInlineTable -> value.entries.find { it.name == "version" }?.value?.text?.unquotedText
+            is TomlLiteral -> value.stringValue
+            is TomlInlineTable -> value.entries.find { it.name == "version" }?.value?.stringValue
             else -> null
         }
     }
 
-private val String.unquotedText get() = this.removePrefix("\\"").removeSuffix("\\"")
+private val TomlValue.stringValue: String? get() {
+    val kind = (this as? TomlLiteral)?.kind
+    return (kind as? TomlLiteralKind.String)?.value
+}
diff --git a/toml/src/test/kotlin/org/rust/toml/CargoCrateDocLineMarkerProviderTest.kt b/toml/src/test/kotlin/org/rust/toml/CargoCrateDocLineMarkerProviderTest.kt
index 9524c4615..0af871af5 100644
--- a/toml/src/test/kotlin/org/rust/toml/CargoCrateDocLineMarkerProviderTest.kt
+++ b/toml/src/test/kotlin/org/rust/toml/CargoCrateDocLineMarkerProviderTest.kt
@@ -83,4 +83,12 @@ class CargoCrateDocLineMarkerProviderTest : RsTestBase() {
         [dependencies]
         config_rs = { package = "config", version = "0.9" }  # - Open documentation for `config@0.9`
     """)
+
+    fun `test unescape string literals`() = doTestByText("""
+        [dependencies]
+        serde = '1.0.104'  # - Open documentation for `serde@1.0.104`
+        serde_json = { version = '''1.0.104''' }  # - Open documentation for `serde_json@1.0.104`
+        serde_yaml_rs = { package = 'serde_yaml', version = '''0.8.11''' }  # - Open documentation for `serde_yaml@0.8.11`
+        serde_derive_rs = { package = "serde\\u005Fderive", version ="1\\u002E0\\u002E104" }  # - Open documentation for `serde_derive@1.0.104`
+    """)
 }