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> </head>
<body class="flex justify-center"> <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> <div>
<h1>Medium.rip</h1> <h1>Medium.rip</h1>
<h2>An alternative frontend to Medium</h2> <h2>An alternative frontend to Medium</h2>

View File

@ -17,7 +17,7 @@
</head> </head>
<body class="flex flex-col h-full w-full items-center"> <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> <h1 class="text-2xl">{{.Title}}</h1>
<p class="pb-8"><a href="https://medium.com/u/{{.UserId}}">{{.Author}}</a> on {{.PublishDate}}</p> <p class="pb-8"><a href="https://medium.com/u/{{.UserId}}">{{.Author}}</a> on {{.PublishDate}}</p>
{{.Paragraphs}} {{.Paragraphs}}

View File

@ -1,7 +1,6 @@
package converters package converters
import ( import (
"encoding/json"
"testing" "testing"
"github.com/medium.rip/pkg/entities" "github.com/medium.rip/pkg/entities"
@ -59,32 +58,20 @@ func TestRanges(t *testing.T) {
} }
func TestConvert(t *testing.T) { func TestConvert(t *testing.T) {
jsonData := `{ markup := ConvertMarkup("<strong> and emphasized only", []entities.Markup{
"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": [
{ {
"title": null, Type: "STRONG",
"type": "CODE", Start: 0,
"href": null, End: 12,
"userId": null, },
"start": 287, {
"end": 293, Type: "EM",
"anchorType": null 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)) ps.WriteString(fmt.Sprintf("<ul>%s</ul>", listItems))
case "P": case "P":
children := ConvertMarkup(p.Text, p.Markups) children := ConvertMarkup(p.Text, p.Markups)
if p.Name == "ca5b" {
fmt.Println(children)
}
ps.WriteString(fmt.Sprintf("<p>%s</p>", children)) ps.WriteString(fmt.Sprintf("<p>%s</p>", children))
case "PRE": case "PRE":
children := ConvertMarkup(p.Text, p.Markups) children := ConvertMarkup(p.Text, p.Markups)