fix(mobile): restrict maximum width

Signed-off-by: Sphericalkat <amolele@gmail.com>
This commit is contained in:
Amogh Lele 2023-05-28 20:06:44 +05:30
parent 264410c8d7
commit 45f3b842c8
4 changed files with 17 additions and 33 deletions

View File

@ -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>

View File

@ -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}}

View File

@ -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, its common to delegate redirects and error throwing to a React app rendered after the data has been fetched. This wont work if youve already sent an early <head> tag and a 200 OK status.",
"type": "P",
"href": null,
"layout": null,
"markups": [
markup := ConvertMarkup("<strong> and emphasized only", []entities.Markup{
{
"title": null,
"type": "CODE",
"href": null,
"userId": null,
"start": 287,
"end": 293,
"anchorType": null
Type: "STRONG",
Start: 0,
End: 12,
},
{
Type: "EM",
Start: 9,
End: 23,
},
})
if markup != "<strong>&lt;strong&gt; </strong><em>&lt;strong&gt;and&lt;/strong&gt;</em><em> emphasized</em> only" {
t.Errorf("Expected markup to be <strong>&lt;strong&gt; </strong><em>&lt;strong&gt;and&lt;/strong&gt;</em><em> emphasized</em> only only, got %s", markup)
}
],
"iframe": null,
"metadata": null
}`
p := new(entities.Paragraph)
_ = json.Unmarshal([]byte(jsonData), p)
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)
// }
}

View File

@ -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)