mirror of
https://github.com/SphericalKat/medium.rip.git
synced 2024-12-26 01:25:57 +00:00
fix(mobile): restrict maximum width
Signed-off-by: Sphericalkat <amolele@gmail.com>
This commit is contained in:
parent
264410c8d7
commit
45f3b842c8
@ -14,7 +14,7 @@
|
||||
</head>
|
||||
|
||||
<body class="flex justify-center">
|
||||
<article class="flex flex-col h-full w-full justify-center prose">
|
||||
<article class="flex flex-col h-full w-full justify-center prose px-8 md:px-0">
|
||||
<div>
|
||||
<h1>Medium.rip</h1>
|
||||
<h2>An alternative frontend to Medium</h2>
|
||||
|
@ -17,7 +17,7 @@
|
||||
</head>
|
||||
|
||||
<body class="flex flex-col h-full w-full items-center">
|
||||
<article class="prose lg:prose-lg sm:prose-sm py-20">
|
||||
<article class="prose lg:prose-lg sm:prose-sm py-20 px-8 md:px-0 max-w-sm sm:max-w-none">
|
||||
<h1 class="text-2xl">{{.Title}}</h1>
|
||||
<p class="pb-8"><a href="https://medium.com/u/{{.UserId}}">{{.Author}}</a> on {{.PublishDate}}</p>
|
||||
{{.Paragraphs}}
|
||||
|
@ -1,7 +1,6 @@
|
||||
package converters
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
"testing"
|
||||
|
||||
"github.com/medium.rip/pkg/entities"
|
||||
@ -59,32 +58,20 @@ func TestRanges(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestConvert(t *testing.T) {
|
||||
jsonData := `{
|
||||
"name": "254a",
|
||||
"text": "Early Flush prevents subsequent changes to the headers (e.g to redirect or change the status code). In the React + NodeJS world, it’s common to delegate redirects and error throwing to a React app rendered after the data has been fetched. This won’t work if you’ve already sent an early <head> tag and a 200 OK status.",
|
||||
"type": "P",
|
||||
"href": null,
|
||||
"layout": null,
|
||||
"markups": [
|
||||
{
|
||||
"title": null,
|
||||
"type": "CODE",
|
||||
"href": null,
|
||||
"userId": null,
|
||||
"start": 287,
|
||||
"end": 293,
|
||||
"anchorType": null
|
||||
}
|
||||
],
|
||||
"iframe": null,
|
||||
"metadata": null
|
||||
}`
|
||||
p := new(entities.Paragraph)
|
||||
_ = json.Unmarshal([]byte(jsonData), p)
|
||||
markup := ConvertMarkup("<strong> and emphasized only", []entities.Markup{
|
||||
{
|
||||
Type: "STRONG",
|
||||
Start: 0,
|
||||
End: 12,
|
||||
},
|
||||
{
|
||||
Type: "EM",
|
||||
Start: 9,
|
||||
End: 23,
|
||||
},
|
||||
})
|
||||
|
||||
ConvertMarkup(p.Text, p.Markups)
|
||||
|
||||
// if markup != "<strong>strong </strong><em><strong>and</strong></em><em> emphasized</em> only" {
|
||||
// t.Errorf("Expected markup to be <strong>strong </strong><em><strong>and</strong></em><em> emphasized</em> only, got %s", markup)
|
||||
// }
|
||||
if markup != "<strong><strong> </strong><em><strong>and</strong></em><em> emphasized</em> only" {
|
||||
t.Errorf("Expected markup to be <strong><strong> </strong><em><strong>and</strong></em><em> emphasized</em> only only, got %s", markup)
|
||||
}
|
||||
}
|
||||
|
@ -107,9 +107,6 @@ func ConvertParagraphs(paragraphs []entities.Paragraph) string {
|
||||
ps.WriteString(fmt.Sprintf("<ul>%s</ul>", listItems))
|
||||
case "P":
|
||||
children := ConvertMarkup(p.Text, p.Markups)
|
||||
if p.Name == "ca5b" {
|
||||
fmt.Println(children)
|
||||
}
|
||||
ps.WriteString(fmt.Sprintf("<p>%s</p>", children))
|
||||
case "PRE":
|
||||
children := ConvertMarkup(p.Text, p.Markups)
|
||||
|
Loading…
Reference in New Issue
Block a user