1
0
Эх сурвалжийг харах

Update EditHistoryModal, fix caption rendering

Daniel Supernault 2 жил өмнө
parent
commit
0f803446dd

+ 2 - 1
app/Http/Controllers/StatusEditController.php

@@ -44,8 +44,9 @@ class StatusEditController extends Controller
     	$cached = StatusService::get($status->id, false);
     	$cached = StatusService::get($status->id, false);
 
 
     	$res = $status->edits->map(function($edit) use($cached) {
     	$res = $status->edits->map(function($edit) use($cached) {
+    		$caption = nl2br(strip_tags(str_replace('</p>', "\n", $edit->caption)));
     		return [
     		return [
-    			'content' => Autolink::create()->autolink($edit->caption),
+    			'content' => Autolink::create()->autolink($caption),
     			'spoiler_text' => $edit->spoiler_text,
     			'spoiler_text' => $edit->spoiler_text,
     			'sensitive' => (bool) $edit->is_nsfw,
     			'sensitive' => (bool) $edit->is_nsfw,
     			'created_at' => str_replace('+00:00', 'Z', $edit->created_at->format(DATE_RFC3339_EXTENDED)),
     			'created_at' => str_replace('+00:00', 'Z', $edit->created_at->format(DATE_RFC3339_EXTENDED)),

+ 3 - 1
resources/assets/components/partials/post/EditHistoryModal.vue

@@ -121,7 +121,9 @@
 							</div>
 							</div>
 						</div>
 						</div>
 					</template>
 					</template>
-					<p class="lead my-4" v-html="allHistory[historyIndex].content"></p>
+					<div class="w-100 my-4 px-4 text-break justify-content-start">
+						<p class="mb-0" v-html="allHistory[historyIndex].content"></p>
+					</div>
 				</div>
 				</div>
 			</template>
 			</template>